Docker daemon.json配置[備忘]

daemon.json

{
    "api-cors-header":"", 
    "authorization-plugins":[], 
    "bip": "", 
    "bridge":"", 
    "cgroup-parent":"", 
    "cluster-store":"", 
    "cluster-store-opts":{}, 
    "cluster-advertise":"", 
    "debug": true, #啓用debug的模式,啓用後,可以看到很多的啓動信息。默認false 
    "default-gateway":"", 
    "default-gateway-v6":"", 
    "default-runtime":"runc", 
    "default-ulimits":{}, 
    "disable-legacy-registry":false, 
    "dns": ["192.168.1.1"], # 設定容器dns的地址,在容器的 /etc/resolv.conf文件中可查看。
    "dns-opts": [], #  容器 /etc/resolv.conf 文件,其他設置
    "dns-search": [], # 設定容器的搜索域,當設定爲.example.com時,在搜索一個名爲host的主機時,dns不僅搜索host,還會搜索host.example.com。如果不設置,默認使用主機上的/etc/resolv.conf 來配置容器。
    "exec-opts": [], 
    "exec-root":"", 
    "fixed-cidr":"", 
    "fixed-cidr-v6":"", 
    "graph":"/var/lib/docker", #已廢棄,使用data-root代替,這個主要看docker的版本 
    "data-root":"/var/lib/docker", #docker運行時使用的根路徑,根路徑下的內容稍後介紹,默認/var/lib/docker 
    "group": "", #unix套接字的屬組,僅指/var/run/docker.sock 
    "hosts": [], #設置容器hosts 
    "icc": false, 
    "insecure-registries": [], #配置docker的私庫地址 
    "ip":"0.0.0.0", 
    "iptables": false, 
    "ipv6": false, 
    "ip-forward": false, #默認true, 啓用 net.ipv4.ip_forward ,進入容器後使用 sysctl -a | grepnet.ipv4.ip_forward 查看 
    "ip-masq":false, 
    "labels":["nodename=node-121"], # docker主機的標籤,很實用的功能,例如定義:–label nodename=host-121
    "live-restore": true, 
    "log-driver":"", 
    "log-level":"", 
    "log-opts": {}, 
    "max-concurrent-downloads":3, 
    "max-concurrent-uploads":5, 
    "mtu": 0, 
    "oom-score-adjust":-500, 
    "pidfile": "", #docker守護進程的pid文件 
    "raw-logs": false, 
    "registry-mirrors":["xxxx"], #鏡像加速的地址,增加後在 docker info中可查看。
    "runtimes": {
        "runc": {
            "path": "runc"
        },
        "custom": {
            "path": "/usr/local/bin/my-runc-replacement",
            "runtimeargs": ["--debug"]
        }
    }, 
    "selinux-enabled": false, #默認 false,啓用selinux支持 
    "storage-driver":"", 
    "storage-opts": [], 
    "swarm-default-advertise-addr":"", 
    "tls": true, #默認 false, 啓動tls認證開關 
    "tlscacert": "", #默認 ~/.docker/ca.pem,通過ca認證過的的certificate文件路徑 
    "tlscert": "", #默認 ~/.docker/cert.pem ,tls的certificate文件路徑 
    "tlskey": "", #默認~/.docker/key.pem,tls的key文件路徑 
    "tlsverify": true, #默認false,使用tls並做後臺進程與客戶端通訊的驗證 
    "userland-proxy":false, 
    "userns-remap":"" 
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章