Docker deep 2-linux configuration file Daemon.json Use example

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.