docker 配置文件:/etc/docker/daemon.json

/etc/docker/daemon.json 是 docker 的配置文件,默认是没有的,需要我们手动创建,可配置项如下:

[[email protected] ~]$ vim /etc/docker/daemon.json
{
    "authorization-plugins": [],
    "data-root": "",   # 设置docker运行时的根目录
    "dns": [],         # 设置容器的DNS地址
    "dns-opts": [],    # 设置容器的/etc/resolv.conf文件
    "dns-search": [],
    "exec-opts": [],
    "exec-root": "",
    "experimental": false,
    "features": {},
    "storage-driver": "",
    "storage-opts": [],
    "labels": [],
    "live-restore": true,
    "log-driver": "json-file",
    "log-opts": {
        "max-size": "10m",
        "max-files":"5",
        "labels": "somelabel",
        "env": "os,customer"
    },
    "mtu": 0,
    "pidfile": "",    # 设置docker守护进程的PID文件
    "cluster-store": "",
    "cluster-store-opts": {},
    "cluster-advertise": "",
    "max-concurrent-downloads": 3,
    "max-concurrent-uploads": 5,
    "default-shm-size": "64M",
    "shutdown-timeout": 15,
    "debug": true,    # 是否以debug模式启动docker
    "hosts": [],      # 设置容器的hosts
    "log-level": "",
    "tls": true,
    "tlsverify": true,
    "tlscacert": "",
    "tlscert": "",
    "tlskey": "",
    "swarm-default-advertise-addr": "",
    "api-cors-header": "",
    "selinux-enabled": false,    # 设置是否支持SELinux
    "userns-remap": "",
    "group": "",
    "cgroup-parent": "",
    "default-ulimits": {
        "nofile": {
            "Name": "nofile",
            "Hard": 64000,
            "Soft": 64000
        }
    },
    "init": false,
    "init-path": "/usr/libexec/docker-init",
    "ipv6": false,
    "iptables": false,
    "ip-forward": false,
    "ip-masq": false,
    "userland-proxy": false,
    "userland-proxy-path": "/usr/libexec/docker-proxy",
    "ip": "0.0.0.0",
    "bridge": "",
    "bip": "",
    "fixed-cidr": "",
    "fixed-cidr-v6": "",
    "default-gateway": "",
    "default-gateway-v6": "",
    "icc": false,
    "raw-logs": false,
    "allow-nondistributable-artifacts": [],
    "registry-mirrors": [],       # 设置镜像加速地址
    "seccomp-profile": "",
    "insecure-registries": [],    # 设置docker的私有仓库地址
    "no-new-privileges": false,
    "default-runtime": "runc",
    "oom-score-adjust": -500,
    "node-generic-resources": ["NVIDIA-GPU=UUID1", "NVIDIA-GPU=UUID2"],
    "runtimes": {
        "cc-runtime": {
            "path": "/usr/bin/cc-runtime"
        },
        "custom": {
            "path": "/usr/local/bin/my-runc-replacement",
            "runtimeArgs": [
                "--debug"
            ]
        }
    },
    "default-address-pools":[{"base":"172.80.0.0/16","size":24},
    {"base":"172.90.0.0/16","size":24}]
}

原文地址:https://www.cnblogs.com/pzk7788/p/10180197.html

时间: 2024-08-29 21:52:54

docker 配置文件:/etc/docker/daemon.json的相关文章

docker深入2-linux下的配置文件daemon.json使用示例

2016/12/9 一.现状 1.默认没有这个配置文件,手动创建一个即可. 2.我们目前使用过的操作 在"docker深入2-存储驱动之使用devicemapper(direct-lvm)模式"这一节中,我们是这样操作的: --------------------------------------- 调整 daemon.json 的配置: [[email protected] ~]# cat /etc/docker/daemon.json {     "storage-dr

Docker(十六)-Docker的daemon.json的作用

docker安装后默认没有daemon.json这个配置文件,需要进行手动创建.配置文件的默认路径:/etc/docker/daemon.json 一般情况,配置文件 daemon.json中配置的项目参数,在启动参数中同样适用,有些可能不一样(具体可以查看官方文档),但需要注意的一点,配置文件中如果已经有某个配置项,则无法在启动参数中增加,会出现冲突的错误. 如果在daemon.json文件中进行配置,需要docker版本高于1.12.6(在这个版本上不生效,1.13.1以上是生效的) 参数 

docker daemon.json 配置

下面是自己设置的 /etc/docker/daemon.json 文件中的配置案例 [[email protected] docker]# cat daemon.json { "registry-mirrors": ["https://vaflkxbk.mirror.aliyuncs.com"], "storage-driver":"devicemapper", "storage-opts": [ &quo

FATA[0000] Get http:///var/run/docker.sock/v1.18/images/json: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?

>> docker imagesFATA[0000] Get http:///var/run/docker.sock/v1.18/images/json: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS? solution: Execute 'service docker restart'. If vm

/etc/docker/daemon.json 配置参数

/etc/docker/daemon.json 配置参数: 参考: http://www.mamicode.com/info-detail-2876703.html https://blog.csdn.net/java_xinshou1/article/details/102620028 https://www.2cto.com/net/201808/773544.html ========================================================== ca

阿里云容器服务与 ASP.NET Core 的 Docker 部署:用 docker secrets 保存 appsettings.Production.json

这是我们使用阿里云容器服务基于 docker 容器部署 asp.net core 应用遇到的另一个问题 —— 如果将包含敏感信息的应用配置文件 appsettings.Production.json 传递给运行在容器中的 asp.net core 应用. Docker 针对这样的应用场景已经提供了解决方案 —— Docker Secrets,对应的 docker 命令是 docker secret .我们就用 docker secrets 解决了这个问题,在这篇随笔中分享一下. 首先在阿里云容器

输入docker ps 报错信息处理Get http:///var/run/docker.sock/v1.19/containers/json: dial unix /var/run/docker.sock: permission denied.

完整错误信息 Get http:///var/run/docker.sock/v1.19/containers/json: dial unix /var/run/docker.sock: permission denied. Are you trying to connect to a TLS-enabled daemon without TLS? 原因: 1.未使用root用户进行操作 2.未让docker以daemon方式运行/bin/bash 解决方案: 1.没有使用root 在控制台上切

Docker -- 安全/部分命令/Daemon

Docker -- 终极指南 1.安装过程 -- Docker -- docker pull 镜像 -- docker images 列出镜像    -- docker run --rm -ti ubuntu /bin/bash 创建容器  (rm:进程退出即删除容器,用来测试)   -- docker ps 查看容器 -- docker exec -ti name /bin/bash 进入容器  -- exit 退出    2.Linux命名空间 UTS (UNIX Time-sharing

docker: Error response from daemon: driver failed programming external connectivity on endpoint jolly_shockley

1. docker 启动image错误 docker: Error response from daemon: driver failed programming external connectivity on endpoint jolly_shockley (957a1271cd0ae4f9f28163b7cdf5c17d6110fcd6ccd2ca79f2cf0ab8c67dfd52): (iptables failed: iptables --wait -t nat -A DOCKER