Docker deep 2-linux configuration file Daemon.json Use example
2016/12/9
First, the status quo 1, the default does not have this configuration file, manually create one. 2. The operations we are currently using are in the section "Docker in-depth 2-storage-driven use Devicemapper (DIRECT-LVM) mode", Here's how we do it:---------------------------------------adjustment daemon.json configuration: [[email protected] ~]# cat /etc/docker/daemon.json{ "Storage-driver": "Devicemapper", "storage-opts": [ "dm.thinpooldev=/dev/ Mapper/docker-thinpool ", " Dm.use_deferred_removal=true ", "Dm.use_deferred_deletion=true"     ]}----------- ----------------------------defines the value of storage-driver . Then restart the service: [[Email protected] ~]# systemctl restart docker && systemctl status docker -l the benefits of doing this: when adjusting the configuration, it's not necessary to modify the parameters of the docker.service, which is more clearly and rationally managed by the configuration file. Second, explore 1, Linux a complete configuration example { "Api-cors-header": "", "AuthorizAtion-plugins ": [], " Bip ": " ", " Bridge ": " ", "Cgroup-parent": ", " Cluster-store ": " ", "cluster-store-opts": {}, "cluster-advertise": "", "Debug": true, "Default-gateway": ", " Default-gateway-v6 ": " ", " Default-runtime ": " Runc ", " Default-ulimits ": {}, " Disable-legacy-registry ": false, "DNS": [], "dns-opts": [], "Dns-search": [] , "exec-opts": [], "Exec-root": "", "FIXED-CIDR": ", " fixed-cidr-v6 ": " ", " graph ": "", " Group ": " ", " hosts ": [], " ICC ": false, "insecure-registries": [], "IP": "0.0.0.0", "iptables": false, "IPv6": false, " Ip-forward ": false, " IP-MASQ ": false, " labels ": [ ], "Live-restore": true, "Log-driver": "", "Log-level": ", " log-opts ": {}, " Max-concurrent-downloads ": 3, " Max-concurrent-uploads ": 5, "MTU": 0, "Oom-score-adjust": -500, "Pidfile": ", " Raw-logs ": false, " registry-mirrors ": [], "runtimes": { " Runc ": { "path": "Runc"         }, "Custom": { "path": "/usr/local/bin/my-runc-replacement", "Runtimeargs": [ "--debug" ] } }, "selinux-enabled": false, "Storage-driver": "", "storage-opts": [], "swarm-default-advertise-addr": "", "TLS": true, "Tlscacert": ", " Tlscert ": " ", "Tlskey": ", " tlsverify ": true, " Userland-proxy ": false, " Userns-remap ": "} above is a sample configuration provided by the official website, which we can refer to, optionally configuring some of the content. 2. How to configure registry related parameters involves the following 2 parameters: "Insecure-registries": [], "registry-mirrors": [], configuration example: [[email protected] ~]# cat /etc/docker/ daemon.json{ "Storage-driver": "Devicemapper", " Storage-opts ": [ " dm.thinpooldev=/dev/mapper/ Docker-thinpool ", " Dm.use_deferred_removal=true ", "Dm.use_deferred_deletion=true" ], "Registry-mirrors": [ "http://m.hub.test.com" ], " Insecure-registries ": [ " hub.test.com "  ]}        ZYXW, reference 1, docshttps://docs.docker.com/engine/reference/ Commandline/dockerd/#/linux-configuration-file
Docker deep 2-linux configuration file Daemon.json Use example