github.com/ncdc/docker@v0.10.1-0.20160129113957-6c6729ef5b74/docs/reference/commandline/daemon.md (about)

     1  <!--[metadata]>
     2  +++
     3  title = "daemon"
     4  description = "The daemon command description and usage"
     5  keywords = ["container, daemon, runtime"]
     6  [menu.main]
     7  parent = "smn_cli"
     8  weight = -1
     9  +++
    10  <![end-metadata]-->
    11  
    12  # daemon
    13  
    14      Usage: docker daemon [OPTIONS]
    15  
    16      A self-sufficient runtime for linux containers.
    17  
    18      Options:
    19        --api-cors-header=""                   Set CORS headers in the remote API
    20        --authorization-plugin=[]              Set authorization plugins to load
    21        -b, --bridge=""                        Attach containers to a network bridge
    22        --bip=""                               Specify network bridge IP
    23        --cgroup-parent=                       Set parent cgroup for all containers
    24        -D, --debug                            Enable debug mode
    25        --default-gateway=""                   Container default gateway IPv4 address
    26        --default-gateway-v6=""                Container default gateway IPv6 address
    27        --cluster-store=""                     URL of the distributed storage backend
    28        --cluster-advertise=""                 Address of the daemon instance on the cluster
    29        --cluster-store-opt=map[]              Set cluster options
    30        --config-file=/etc/docker/daemon.json  Daemon configuration file
    31        --dns=[]                               DNS server to use
    32        --dns-opt=[]                           DNS options to use
    33        --dns-search=[]                        DNS search domains to use
    34        --default-ulimit=[]                    Set default ulimit settings for containers
    35        --exec-opt=[]                          Set exec driver options
    36        --exec-root="/var/run/docker"          Root of the Docker execdriver
    37        --fixed-cidr=""                        IPv4 subnet for fixed IPs
    38        --fixed-cidr-v6=""                     IPv6 subnet for fixed IPs
    39        -G, --group="docker"                   Group for the unix socket
    40        -g, --graph="/var/lib/docker"          Root of the Docker runtime
    41        -H, --host=[]                          Daemon socket(s) to connect to
    42        --help                                 Print usage
    43        --icc=true                             Enable inter-container communication
    44        --insecure-registry=[]                 Enable insecure registry communication
    45        --ip=0.0.0.0                           Default IP when binding container ports
    46        --ip-forward=true                      Enable net.ipv4.ip_forward
    47        --ip-masq=true                         Enable IP masquerading
    48        --iptables=true                        Enable addition of iptables rules
    49        --ipv6                                 Enable IPv6 networking
    50        -l, --log-level="info"                 Set the logging level
    51        --label=[]                             Set key=value labels to the daemon
    52        --log-driver="json-file"               Default driver for container logs
    53        --log-opt=[]                           Log driver specific options
    54        --mtu=0                                Set the containers network MTU
    55        --disable-legacy-registry              Do not contact legacy registries
    56        -p, --pidfile="/var/run/docker.pid"    Path to use for daemon PID file
    57        --registry-mirror=[]                   Preferred Docker registry mirror
    58        -s, --storage-driver=""                Storage driver to use
    59        --selinux-enabled                      Enable selinux support
    60        --storage-opt=[]                       Set storage driver options
    61        --tls                                  Use TLS; implied by --tlsverify
    62        --tlscacert="~/.docker/ca.pem"         Trust certs signed only by this CA
    63        --tlscert="~/.docker/cert.pem"         Path to TLS certificate file
    64        --tlskey="~/.docker/key.pem"           Path to TLS key file
    65        --tlsverify                            Use TLS and verify the remote
    66        --userns-remap="default"               Enable user namespace remapping
    67        --userland-proxy=true                  Use userland proxy for loopback traffic
    68  
    69  Options with [] may be specified multiple times.
    70  
    71  The Docker daemon is the persistent process that manages containers. Docker
    72  uses the same binary for both the daemon and client. To run the daemon you
    73  type `docker daemon`.
    74  
    75  To run the daemon with debug output, use `docker daemon -D`.
    76  
    77  ## Daemon socket option
    78  
    79  The Docker daemon can listen for [Docker Remote API](../api/docker_remote_api.md)
    80  requests via three different types of Socket: `unix`, `tcp`, and `fd`.
    81  
    82  By default, a `unix` domain socket (or IPC socket) is created at
    83  `/var/run/docker.sock`, requiring either `root` permission, or `docker` group
    84  membership.
    85  
    86  If you need to access the Docker daemon remotely, you need to enable the `tcp`
    87  Socket. Beware that the default setup provides un-encrypted and
    88  un-authenticated direct access to the Docker daemon - and should be secured
    89  either using the [built in HTTPS encrypted socket](../../security/https/), or by
    90  putting a secure web proxy in front of it. You can listen on port `2375` on all
    91  network interfaces with `-H tcp://0.0.0.0:2375`, or on a particular network
    92  interface using its IP address: `-H tcp://192.168.59.103:2375`. It is
    93  conventional to use port `2375` for un-encrypted, and port `2376` for encrypted
    94  communication with the daemon.
    95  
    96  > **Note:**
    97  > If you're using an HTTPS encrypted socket, keep in mind that only
    98  > TLS1.0 and greater are supported. Protocols SSLv3 and under are not
    99  > supported anymore for security reasons.
   100  
   101  On Systemd based systems, you can communicate with the daemon via
   102  [Systemd socket activation](http://0pointer.de/blog/projects/socket-activation.html),
   103  use `docker daemon -H fd://`. Using `fd://` will work perfectly for most setups but
   104  you can also specify individual sockets: `docker daemon -H fd://3`. If the
   105  specified socket activated files aren't found, then Docker will exit. You can
   106  find examples of using Systemd socket activation with Docker and Systemd in the
   107  [Docker source tree](https://github.com/docker/docker/tree/master/contrib/init/systemd/).
   108  
   109  You can configure the Docker daemon to listen to multiple sockets at the same
   110  time using multiple `-H` options:
   111  
   112      # listen using the default unix socket, and on 2 specific IP addresses on this host.
   113      docker daemon -H unix:///var/run/docker.sock -H tcp://192.168.59.106 -H tcp://10.10.10.2
   114  
   115  The Docker client will honor the `DOCKER_HOST` environment variable to set the
   116  `-H` flag for the client.
   117  
   118      $ docker -H tcp://0.0.0.0:2375 ps
   119      # or
   120      $ export DOCKER_HOST="tcp://0.0.0.0:2375"
   121      $ docker ps
   122      # both are equal
   123  
   124  Setting the `DOCKER_TLS_VERIFY` environment variable to any value other than
   125  the empty string is equivalent to setting the `--tlsverify` flag. The following
   126  are equivalent:
   127  
   128      $ docker --tlsverify ps
   129      # or
   130      $ export DOCKER_TLS_VERIFY=1
   131      $ docker ps
   132  
   133  The Docker client will honor the `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY`
   134  environment variables (or the lowercase versions thereof). `HTTPS_PROXY` takes
   135  precedence over `HTTP_PROXY`.
   136  
   137  ### Daemon storage-driver option
   138  
   139  The Docker daemon has support for several different image layer storage
   140  drivers: `aufs`, `devicemapper`, `btrfs`, `zfs` and `overlay`.
   141  
   142  The `aufs` driver is the oldest, but is based on a Linux kernel patch-set that
   143  is unlikely to be merged into the main kernel. These are also known to cause
   144  some serious kernel crashes. However, `aufs` is also the only storage driver
   145  that allows containers to share executable and shared library memory, so is a
   146  useful choice when running thousands of containers with the same program or
   147  libraries.
   148  
   149  The `devicemapper` driver uses thin provisioning and Copy on Write (CoW)
   150  snapshots. For each devicemapper graph location – typically
   151  `/var/lib/docker/devicemapper` – a thin pool is created based on two block
   152  devices, one for data and one for metadata. By default, these block devices
   153  are created automatically by using loopback mounts of automatically created
   154  sparse files. Refer to [Storage driver options](#storage-driver-options) below
   155  for a way how to customize this setup.
   156  [~jpetazzo/Resizing Docker containers with the Device Mapper plugin](http://jpetazzo.github.io/2014/01/29/docker-device-mapper-resize/)
   157  article explains how to tune your existing setup without the use of options.
   158  
   159  The `btrfs` driver is very fast for `docker build` - but like `devicemapper`
   160  does not share executable memory between devices. Use
   161  `docker daemon -s btrfs -g /mnt/btrfs_partition`.
   162  
   163  The `zfs` driver is probably not as fast as `btrfs` but has a longer track record
   164  on stability. Thanks to `Single Copy ARC` shared blocks between clones will be
   165  cached only once. Use `docker daemon -s zfs`. To select a different zfs filesystem
   166  set `zfs.fsname` option as described in [Storage driver options](#storage-driver-options).
   167  
   168  The `overlay` is a very fast union filesystem. It is now merged in the main
   169  Linux kernel as of [3.18.0](https://lkml.org/lkml/2014/10/26/137). Call
   170  `docker daemon -s overlay` to use it.
   171  
   172  > **Note:**
   173  > As promising as `overlay` is, the feature is still quite young and should not
   174  > be used in production. Most notably, using `overlay` can cause excessive
   175  > inode consumption (especially as the number of images grows), as well as
   176  > being incompatible with the use of RPMs.
   177  
   178  > **Note:**
   179  > It is currently unsupported on `btrfs` or any Copy on Write filesystem
   180  > and should only be used over `ext4` partitions.
   181  
   182  ### Storage driver options
   183  
   184  Particular storage-driver can be configured with options specified with
   185  `--storage-opt` flags. Options for `devicemapper` are prefixed with `dm` and
   186  options for `zfs` start with `zfs`.
   187  
   188  *  `dm.thinpooldev`
   189  
   190       Specifies a custom block storage device to use for the thin pool.
   191  
   192       If using a block device for device mapper storage, it is best to use `lvm`
   193       to create and manage the thin-pool volume. This volume is then handed to Docker
   194       to exclusively create snapshot volumes needed for images and containers.
   195  
   196       Managing the thin-pool outside of Docker makes for the most feature-rich
   197       method of having Docker utilize device mapper thin provisioning as the
   198       backing storage for Docker's containers. The highlights of the lvm-based
   199       thin-pool management feature include: automatic or interactive thin-pool
   200       resize support, dynamically changing thin-pool features, automatic thinp
   201       metadata checking when lvm activates the thin-pool, etc.
   202  
   203       As a fallback if no thin pool is provided, loopback files will be
   204       created. Loopback is very slow, but can be used without any
   205       pre-configuration of storage. It is strongly recommended that you do
   206       not use loopback in production. Ensure your Docker daemon has a
   207       `--storage-opt dm.thinpooldev` argument provided.
   208  
   209       Example use:
   210  
   211          $ docker daemon \
   212                --storage-opt dm.thinpooldev=/dev/mapper/thin-pool
   213  
   214  *  `dm.basesize`
   215  
   216      Specifies the size to use when creating the base device, which limits the
   217      size of images and containers. The default value is 10G. Note, thin devices
   218      are inherently "sparse", so a 10G device which is mostly empty doesn't use
   219      10 GB of space on the pool. However, the filesystem will use more space for
   220      the empty case the larger the device is.
   221  
   222      The base device size can be increased at daemon restart which will allow
   223      all future images and containers (based on those new images) to be of the
   224      new base device size.
   225  
   226      Example use:
   227  
   228          $ docker daemon --storage-opt dm.basesize=50G
   229  
   230      This will increase the base device size to 50G. The Docker daemon will throw an
   231      error if existing base device size is larger than 50G. A user can use
   232      this option to expand the base device size however shrinking is not permitted.
   233  
   234      This value affects the system-wide "base" empty filesystem
   235      that may already be initialized and inherited by pulled images. Typically,
   236      a change to this value requires additional steps to take effect:
   237  
   238          $ sudo service docker stop
   239          $ sudo rm -rf /var/lib/docker
   240          $ sudo service docker start
   241  
   242      Example use:
   243  
   244          $ docker daemon --storage-opt dm.basesize=20G
   245  
   246  *  `dm.loopdatasize`
   247  
   248      > **Note**:
   249  	> This option configures devicemapper loopback, which should not
   250  	> be used in production.
   251  
   252      Specifies the size to use when creating the loopback file for the
   253      "data" device which is used for the thin pool. The default size is
   254      100G. The file is sparse, so it will not initially take up this
   255      much space.
   256  
   257      Example use:
   258  
   259          $ docker daemon --storage-opt dm.loopdatasize=200G
   260  
   261  *  `dm.loopmetadatasize`
   262  
   263      > **Note**:
   264      > This option configures devicemapper loopback, which should not
   265      > be used in production.
   266  
   267      Specifies the size to use when creating the loopback file for the
   268      "metadata" device which is used for the thin pool. The default size
   269      is 2G. The file is sparse, so it will not initially take up
   270      this much space.
   271  
   272      Example use:
   273  
   274          $ docker daemon --storage-opt dm.loopmetadatasize=4G
   275  
   276  *  `dm.fs`
   277  
   278      Specifies the filesystem type to use for the base device. The supported
   279      options are "ext4" and "xfs". The default is "xfs"
   280  
   281      Example use:
   282  
   283          $ docker daemon --storage-opt dm.fs=ext4
   284  
   285  *  `dm.mkfsarg`
   286  
   287      Specifies extra mkfs arguments to be used when creating the base device.
   288  
   289      Example use:
   290  
   291          $ docker daemon --storage-opt "dm.mkfsarg=-O ^has_journal"
   292  
   293  *  `dm.mountopt`
   294  
   295      Specifies extra mount options used when mounting the thin devices.
   296  
   297      Example use:
   298  
   299          $ docker daemon --storage-opt dm.mountopt=nodiscard
   300  
   301  *  `dm.datadev`
   302  
   303      (Deprecated, use `dm.thinpooldev`)
   304  
   305      Specifies a custom blockdevice to use for data for the thin pool.
   306  
   307      If using a block device for device mapper storage, ideally both datadev and
   308      metadatadev should be specified to completely avoid using the loopback
   309      device.
   310  
   311      Example use:
   312  
   313          $ docker daemon \
   314                --storage-opt dm.datadev=/dev/sdb1 \
   315                --storage-opt dm.metadatadev=/dev/sdc1
   316  
   317  *  `dm.metadatadev`
   318  
   319      (Deprecated, use `dm.thinpooldev`)
   320  
   321      Specifies a custom blockdevice to use for metadata for the thin pool.
   322  
   323      For best performance the metadata should be on a different spindle than the
   324      data, or even better on an SSD.
   325  
   326      If setting up a new metadata pool it is required to be valid. This can be
   327      achieved by zeroing the first 4k to indicate empty metadata, like this:
   328  
   329          $ dd if=/dev/zero of=$metadata_dev bs=4096 count=1
   330  
   331      Example use:
   332  
   333          $ docker daemon \
   334                --storage-opt dm.datadev=/dev/sdb1 \
   335                --storage-opt dm.metadatadev=/dev/sdc1
   336  
   337  *  `dm.blocksize`
   338  
   339      Specifies a custom blocksize to use for the thin pool. The default
   340      blocksize is 64K.
   341  
   342      Example use:
   343  
   344          $ docker daemon --storage-opt dm.blocksize=512K
   345  
   346  *  `dm.blkdiscard`
   347  
   348      Enables or disables the use of blkdiscard when removing devicemapper
   349      devices. This is enabled by default (only) if using loopback devices and is
   350      required to resparsify the loopback file on image/container removal.
   351  
   352      Disabling this on loopback can lead to *much* faster container removal
   353      times, but will make the space used in `/var/lib/docker` directory not be
   354      returned to the system for other use when containers are removed.
   355  
   356      Example use:
   357  
   358          $ docker daemon --storage-opt dm.blkdiscard=false
   359  
   360  *  `dm.override_udev_sync_check`
   361  
   362      Overrides the `udev` synchronization checks between `devicemapper` and `udev`.
   363      `udev` is the device manager for the Linux kernel.
   364  
   365      To view the `udev` sync support of a Docker daemon that is using the
   366      `devicemapper` driver, run:
   367  
   368          $ docker info
   369          [...]
   370          Udev Sync Supported: true
   371          [...]
   372  
   373      When `udev` sync support is `true`, then `devicemapper` and udev can
   374      coordinate the activation and deactivation of devices for containers.
   375  
   376      When `udev` sync support is `false`, a race condition occurs between
   377      the`devicemapper` and `udev` during create and cleanup. The race condition
   378      results in errors and failures. (For information on these failures, see
   379      [docker#4036](https://github.com/docker/docker/issues/4036))
   380  
   381      To allow the `docker` daemon to start, regardless of `udev` sync not being
   382      supported, set `dm.override_udev_sync_check` to true:
   383  
   384          $ docker daemon --storage-opt dm.override_udev_sync_check=true
   385  
   386      When this value is `true`, the  `devicemapper` continues and simply warns
   387      you the errors are happening.
   388  
   389      > **Note:**
   390      > The ideal is to pursue a `docker` daemon and environment that does
   391      > support synchronizing with `udev`. For further discussion on this
   392      > topic, see [docker#4036](https://github.com/docker/docker/issues/4036).
   393      > Otherwise, set this flag for migrating existing Docker daemons to
   394      > a daemon with a supported environment.
   395  
   396  *  `dm.use_deferred_removal`
   397  
   398      Enables use of deferred device removal if `libdm` and the kernel driver
   399      support the mechanism.
   400  
   401      Deferred device removal means that if device is busy when devices are
   402      being removed/deactivated, then a deferred removal is scheduled on
   403      device. And devices automatically go away when last user of the device
   404      exits.
   405  
   406      For example, when a container exits, its associated thin device is removed.
   407      If that device has leaked into some other mount namespace and can't be
   408      removed, the container exit still succeeds and this option causes the
   409      system to schedule the device for deferred removal. It does not wait in a
   410      loop trying to remove a busy device.
   411  
   412      Example use:
   413  
   414          $ docker daemon --storage-opt dm.use_deferred_removal=true
   415  
   416  *  `dm.use_deferred_deletion`
   417  
   418      Enables use of deferred device deletion for thin pool devices. By default,
   419      thin pool device deletion is synchronous. Before a container is deleted,
   420      the Docker daemon removes any associated devices. If the storage driver
   421      can not remove a device, the container deletion fails and daemon returns.
   422  
   423          Error deleting container: Error response from daemon: Cannot destroy container
   424  
   425      To avoid this failure, enable both deferred device deletion and deferred
   426      device removal on the daemon.
   427  
   428          $ docker daemon \
   429                --storage-opt dm.use_deferred_deletion=true \
   430                --storage-opt dm.use_deferred_removal=true
   431  
   432      With these two options enabled, if a device is busy when the driver is
   433      deleting a container, the driver marks the device as deleted. Later, when
   434      the device isn't in use, the driver deletes it.
   435  
   436      In general it should be safe to enable this option by default. It will help
   437      when unintentional leaking of mount point happens across multiple mount
   438      namespaces.
   439  
   440  Currently supported options of `zfs`:
   441  
   442  * `zfs.fsname`
   443  
   444      Set zfs filesystem under which docker will create its own datasets.
   445      By default docker will pick up the zfs filesystem where docker graph
   446      (`/var/lib/docker`) is located.
   447  
   448      Example use:
   449  
   450          $ docker daemon -s zfs --storage-opt zfs.fsname=zroot/docker
   451  
   452  ## Docker execdriver option
   453  
   454  The Docker daemon uses a specifically built `libcontainer` execution driver as
   455  its interface to the Linux kernel `namespaces`, `cgroups`, and `SELinux`.
   456  
   457  ## Options for the native execdriver
   458  
   459  You can configure the `native` (libcontainer) execdriver using options specified
   460  with the `--exec-opt` flag. All the flag's options have the `native` prefix. A
   461  single `native.cgroupdriver` option is available.
   462  
   463  The `native.cgroupdriver` option specifies the management of the container's
   464  cgroups. You can specify `cgroupfs` or `systemd`. If you specify `systemd` and
   465  it is not available, the system uses `cgroupfs`. If you omit the
   466  `native.cgroupdriver` option,` cgroupfs` is used.
   467  This example sets the `cgroupdriver` to `systemd`:
   468  
   469      $ sudo docker daemon --exec-opt native.cgroupdriver=systemd
   470  
   471  Setting this option applies to all containers the daemon launches.
   472  
   473  Also Windows Container makes use of `--exec-opt` for special purpose. Docker user
   474  can specify default container isolation technology with this, for example:
   475  
   476      $ docker daemon --exec-opt isolation=hyperv
   477  
   478  Will make `hyperv` the default isolation technology on Windows, without specifying
   479  isolation value on daemon start, Windows isolation technology will default to `process`.
   480  
   481  ## Daemon DNS options
   482  
   483  To set the DNS server for all Docker containers, use
   484  `docker daemon --dns 8.8.8.8`.
   485  
   486  To set the DNS search domain for all Docker containers, use
   487  `docker daemon --dns-search example.com`.
   488  
   489  ## Insecure registries
   490  
   491  Docker considers a private registry either secure or insecure. In the rest of
   492  this section, *registry* is used for *private registry*, and `myregistry:5000`
   493  is a placeholder example for a private registry.
   494  
   495  A secure registry uses TLS and a copy of its CA certificate is placed on the
   496  Docker host at `/etc/docker/certs.d/myregistry:5000/ca.crt`. An insecure
   497  registry is either not using TLS (i.e., listening on plain text HTTP), or is
   498  using TLS with a CA certificate not known by the Docker daemon. The latter can
   499  happen when the certificate was not found under
   500  `/etc/docker/certs.d/myregistry:5000/`, or if the certificate verification
   501  failed (i.e., wrong CA).
   502  
   503  By default, Docker assumes all, but local (see local registries below),
   504  registries are secure. Communicating with an insecure registry is not possible
   505  if Docker assumes that registry is secure. In order to communicate with an
   506  insecure registry, the Docker daemon requires `--insecure-registry` in one of
   507  the following two forms:
   508  
   509  * `--insecure-registry myregistry:5000` tells the Docker daemon that
   510    myregistry:5000 should be considered insecure.
   511  * `--insecure-registry 10.1.0.0/16` tells the Docker daemon that all registries
   512    whose domain resolve to an IP address is part of the subnet described by the
   513    CIDR syntax, should be considered insecure.
   514  
   515  The flag can be used multiple times to allow multiple registries to be marked
   516  as insecure.
   517  
   518  If an insecure registry is not marked as insecure, `docker pull`,
   519  `docker push`, and `docker search` will result in an error message prompting
   520  the user to either secure or pass the `--insecure-registry` flag to the Docker
   521  daemon as described above.
   522  
   523  Local registries, whose IP address falls in the 127.0.0.0/8 range, are
   524  automatically marked as insecure as of Docker 1.3.2. It is not recommended to
   525  rely on this, as it may change in the future.
   526  
   527  Enabling `--insecure-registry`, i.e., allowing un-encrypted and/or untrusted
   528  communication, can be useful when running a local registry.  However,
   529  because its use creates security vulnerabilities it should ONLY be enabled for
   530  testing purposes.  For increased security, users should add their CA to their
   531  system's list of trusted CAs instead of enabling `--insecure-registry`.
   532  
   533  ## Legacy Registries
   534  
   535  Enabling `--disable-legacy-registry` forces a docker daemon to only interact with registries which support the V2 protocol.  Specifically, the daemon will not attempt `push`, `pull` and `login` to v1 registries.  The exception to this is `search` which can still be performed on v1 registries.
   536  
   537  ## Running a Docker daemon behind a HTTPS_PROXY
   538  
   539  When running inside a LAN that uses a `HTTPS` proxy, the Docker Hub
   540  certificates will be replaced by the proxy's certificates. These certificates
   541  need to be added to your Docker host's configuration:
   542  
   543  1. Install the `ca-certificates` package for your distribution
   544  2. Ask your network admin for the proxy's CA certificate and append them to
   545     `/etc/pki/tls/certs/ca-bundle.crt`
   546  3. Then start your Docker daemon with `HTTPS_PROXY=http://username:password@proxy:port/ docker daemon`.
   547     The `username:` and `password@` are optional - and are only needed if your
   548     proxy is set up to require authentication.
   549  
   550  This will only add the proxy and authentication to the Docker daemon's requests -
   551  your `docker build`s and running containers will need extra configuration to
   552  use the proxy
   553  
   554  ## Default Ulimits
   555  
   556  `--default-ulimit` allows you to set the default `ulimit` options to use for
   557  all containers. It takes the same options as `--ulimit` for `docker run`. If
   558  these defaults are not set, `ulimit` settings will be inherited, if not set on
   559  `docker run`, from the Docker daemon. Any `--ulimit` options passed to
   560  `docker run` will overwrite these defaults.
   561  
   562  Be careful setting `nproc` with the `ulimit` flag as `nproc` is designed by Linux to
   563  set the maximum number of processes available to a user, not to a container. For details
   564  please check the [run](run.md) reference.
   565  
   566  ## Nodes discovery
   567  
   568  The `--cluster-advertise` option specifies the 'host:port' or `interface:port`
   569  combination that this particular daemon instance should use when advertising
   570  itself to the cluster. The daemon is reached by remote hosts through this value.
   571  If you  specify an interface, make sure it includes the IP address of the actual
   572  Docker host. For Engine installation created through `docker-machine`, the
   573  interface is typically `eth1`.
   574  
   575  The daemon uses [libkv](https://github.com/docker/libkv/) to advertise
   576  the node within the cluster. Some key-value backends support mutual
   577  TLS. To configure the client TLS settings used by the daemon can be configured
   578  using the `--cluster-store-opt` flag, specifying the paths to PEM encoded
   579  files. For example:
   580  
   581  ```bash
   582  docker daemon \
   583      --cluster-advertise 192.168.1.2:2376 \
   584      --cluster-store etcd://192.168.1.2:2379 \
   585      --cluster-store-opt kv.cacertfile=/path/to/ca.pem \
   586      --cluster-store-opt kv.certfile=/path/to/cert.pem \
   587      --cluster-store-opt kv.keyfile=/path/to/key.pem
   588  ```
   589  
   590  The currently supported cluster store options are:
   591  
   592  *  `discovery.heartbeat`
   593  
   594      Specifies the heartbeat timer in seconds which is used by the daemon as a
   595      keepalive mechanism to make sure discovery module treats the node as alive
   596      in the cluster. If not configured, the default value is 20 seconds.
   597  
   598  *  `discovery.ttl`
   599  
   600      Specifies the ttl (time-to-live) in seconds which is used by the discovery
   601      module to timeout a node if a valid heartbeat is not received within the
   602      configured ttl value. If not configured, the default value is 60 seconds.
   603  
   604  *  `kv.cacertfile`
   605  
   606      Specifies the path to a local file with PEM encoded CA certificates to trust
   607  
   608  *  `kv.certfile`
   609  
   610      Specifies the path to a local file with a PEM encoded certificate.  This
   611      certificate is used as the client cert for communication with the
   612      Key/Value store.
   613  
   614  *  `kv.keyfile`
   615  
   616      Specifies the path to a local file with a PEM encoded private key.  This
   617      private key is used as the client key for communication with the
   618      Key/Value store.
   619  
   620  *  `kv.path`
   621  
   622      Specifies the path in the Key/Value store. If not configured, the default value is 'docker/nodes'.
   623  
   624  ## Access authorization
   625  
   626  Docker's access authorization can be extended by authorization plugins that your
   627  organization can purchase or build themselves. You can install one or more
   628  authorization plugins when you start the Docker `daemon` using the
   629  `--authorization-plugin=PLUGIN_ID` option.
   630  
   631  ```bash
   632  docker daemon --authorization-plugin=plugin1 --authorization-plugin=plugin2,...
   633  ```
   634  
   635  The `PLUGIN_ID` value is either the plugin's name or a path to its specification
   636  file. The plugin's implementation determines whether you can specify a name or
   637  path. Consult with your Docker administrator to get information about the
   638  plugins available to you.
   639  
   640  Once a plugin is installed, requests made to the `daemon` through the command
   641  line or Docker's remote API are allowed or denied by the plugin.  If you have
   642  multiple plugins installed, at least one must allow the request for it to
   643  complete.
   644  
   645  For information about how to create an authorization plugin, see [authorization
   646  plugin](../../extend/authorization.md) section in the Docker extend section of this documentation.
   647  
   648  
   649  ## Daemon user namespace options
   650  
   651  The Linux kernel [user namespace support](http://man7.org/linux/man-pages/man7/user_namespaces.7.html) provides additional security by enabling
   652  a process, and therefore a container, to have a unique range of user and
   653  group IDs which are outside the traditional user and group range utilized by
   654  the host system. Potentially the most important security improvement is that,
   655  by default, container processes running as the `root` user will have expected
   656  administrative privilege (with some restrictions) inside the container but will
   657  effectively be mapped to an unprivileged `uid` on the host.
   658  
   659  When user namespace support is enabled, Docker creates a single daemon-wide mapping
   660  for all containers running on the same engine instance. The mappings will
   661  utilize the existing subordinate user and group ID feature available on all modern
   662  Linux distributions.
   663  The [`/etc/subuid`](http://man7.org/linux/man-pages/man5/subuid.5.html) and
   664  [`/etc/subgid`](http://man7.org/linux/man-pages/man5/subgid.5.html) files will be
   665  read for the user, and optional group, specified to the `--userns-remap`
   666  parameter.  If you do not wish to specify your own user and/or group, you can
   667  provide `default` as the value to this flag, and a user will be created on your behalf
   668  and provided subordinate uid and gid ranges. This default user will be named
   669  `dockremap`, and entries will be created for it in `/etc/passwd` and
   670  `/etc/group` using your distro's standard user and group creation tools.
   671  
   672  > **Note**: The single mapping per-daemon restriction is in place for now
   673  > because Docker shares image layers from its local cache across all
   674  > containers running on the engine instance.  Since file ownership must be
   675  > the same for all containers sharing the same layer content, the decision
   676  > was made to map the file ownership on `docker pull` to the daemon's user and
   677  > group mappings so that there is no delay for running containers once the
   678  > content is downloaded. This design preserves the same performance for `docker
   679  > pull`, `docker push`, and container startup as users expect with
   680  > user namespaces disabled.
   681  
   682  ### Starting the daemon with user namespaces enabled
   683  
   684  To enable user namespace support, start the daemon with the
   685  `--userns-remap` flag, which accepts values in the following formats:
   686  
   687   - uid
   688   - uid:gid
   689   - username
   690   - username:groupname
   691  
   692  If numeric IDs are provided, translation back to valid user or group names
   693  will occur so that the subordinate uid and gid information can be read, given
   694  these resources are name-based, not id-based.  If the numeric ID information
   695  provided does not exist as entries in `/etc/passwd` or `/etc/group`, daemon
   696  startup will fail with an error message.
   697  
   698  *Example: starting with default Docker user management:*
   699  
   700  ```
   701       $ docker daemon --userns-remap=default
   702  ```    
   703  When `default` is provided, Docker will create - or find the existing - user and group
   704  named `dockremap`. If the user is created, and the Linux distribution has
   705  appropriate support, the `/etc/subuid` and `/etc/subgid` files will be populated
   706  with a contiguous 65536 length range of subordinate user and group IDs, starting
   707  at an offset based on prior entries in those files.  For example, Ubuntu will
   708  create the following range, based on an existing user named `user1` already owning
   709  the first 65536 range:
   710  
   711  ```
   712       $ cat /etc/subuid
   713       user1:100000:65536
   714       dockremap:165536:65536
   715  ```
   716  
   717  > **Note:** On a fresh Fedora install, we had to `touch` the
   718  > `/etc/subuid` and `/etc/subgid` files to have ranges assigned when users
   719  > were created.  Once these files existed, range assignment on user creation
   720  > worked properly.
   721  
   722  If you have a preferred/self-managed user with subordinate ID mappings already
   723  configured, you can provide that username or uid to the `--userns-remap` flag.
   724  If you have a group that doesn't match the username, you may provide the `gid`
   725  or group name as well; otherwise the username will be used as the group name
   726  when querying the system for the subordinate group ID range.
   727  
   728  ### Detailed information on `subuid`/`subgid` ranges
   729  
   730  Given potential advanced use of the subordinate ID ranges by power users, the
   731  following paragraphs define how the Docker daemon currently uses the range entries
   732  found within the subordinate range files.
   733  
   734  The simplest case is that only one contiguous range is defined for the
   735  provided user or group. In this case, Docker will use that entire contiguous
   736  range for the mapping of host uids and gids to the container process.  This
   737  means that the first ID in the range will be the remapped root user, and the
   738  IDs above that initial ID will map host ID 1 through the end of the range.
   739  
   740  From the example `/etc/subuid` content shown above, the remapped root
   741  user would be uid 165536.
   742  
   743  If the system administrator has set up multiple ranges for a single user or
   744  group, the Docker daemon will read all the available ranges and use the
   745  following algorithm to create the mapping ranges:
   746  
   747  1. The range segments found for the particular user will be sorted by *start ID* ascending.
   748  2. Map segments will be created from each range in increasing value with a length matching the length of each segment. Therefore the range segment with the lowest numeric starting value will be equal to the remapped root, and continue up through host uid/gid equal to the range segment length. As an example, if the lowest segment starts at ID 1000 and has a length of 100, then a map of 1000 -> 0 (the remapped root) up through 1100 -> 100 will be created from this segment. If the next segment starts at ID 10000, then the next map will start with mapping 10000 -> 101 up to the length of this second segment. This will continue until no more segments are found in the subordinate files for this user.
   749  3. If more than five range segments exist for a single user, only the first five will be utilized, matching the kernel's limitation of only five entries in `/proc/self/uid_map` and `proc/self/gid_map`.
   750  
   751  ### User namespace known restrictions
   752  
   753  The following standard Docker features are currently incompatible when
   754  running a Docker daemon with user namespaces enabled:
   755  
   756   - sharing PID or NET namespaces with the host (`--pid=host` or `--net=host`)
   757   - sharing a network namespace with an existing container (`--net=container:*other*`)
   758   - sharing an IPC namespace with an existing container (`--ipc=container:*other*`)
   759   - A `--readonly` container filesystem (this is a Linux kernel restriction against remounting with modified flags of a currently mounted filesystem when inside a user namespace)
   760   - external (volume or graph) drivers which are unaware/incapable of using daemon user mappings
   761   - Using `--privileged` mode flag on `docker run`
   762  
   763  In general, user namespaces are an advanced feature and will require
   764  coordination with other capabilities. For example, if volumes are mounted from
   765  the host, file ownership will have to be pre-arranged if the user or
   766  administrator wishes the containers to have expected access to the volume
   767  contents.
   768  
   769  Finally, while the `root` user inside a user namespaced container process has
   770  many of the expected admin privileges that go along with being the superuser, the
   771  Linux kernel has restrictions based on internal knowledge that this is a user namespaced
   772  process. The most notable restriction that we are aware of at this time is the
   773  inability to use `mknod`. Permission will be denied for device creation even as
   774  container `root` inside a user namespace.
   775  
   776  ## Miscellaneous options
   777  
   778  IP masquerading uses address translation to allow containers without a public
   779  IP to talk to other machines on the Internet. This may interfere with some
   780  network topologies and can be disabled with `--ip-masq=false`.
   781  
   782  Docker supports softlinks for the Docker data directory (`/var/lib/docker`) and
   783  for `/var/lib/docker/tmp`. The `DOCKER_TMPDIR` and the data directory can be
   784  set like this:
   785  
   786      DOCKER_TMPDIR=/mnt/disk2/tmp /usr/local/bin/docker daemon -D -g /var/lib/docker -H unix:// > /var/lib/docker-machine/docker.log 2>&1
   787      # or
   788      export DOCKER_TMPDIR=/mnt/disk2/tmp
   789      /usr/local/bin/docker daemon -D -g /var/lib/docker -H unix:// > /var/lib/docker-machine/docker.log 2>&1
   790  
   791  
   792  ## Default cgroup parent
   793  
   794  The `--cgroup-parent` option allows you to set the default cgroup parent
   795  to use for containers. If this option is not set, it defaults to `/docker` for
   796  fs cgroup driver and `system.slice` for systemd cgroup driver.
   797  
   798  If the cgroup has a leading forward slash (`/`), the cgroup is created
   799  under the root cgroup, otherwise the cgroup is created under the daemon
   800  cgroup.
   801  
   802  Assuming the daemon is running in cgroup `daemoncgroup`,
   803  `--cgroup-parent=/foobar` creates a cgroup in
   804  `/sys/fs/cgroup/memory/foobar`, wheras using `--cgroup-parent=foobar`
   805  creates the cgroup in `/sys/fs/cgroup/memory/daemoncgroup/foobar`
   806  
   807  This setting can also be set per container, using the `--cgroup-parent`
   808  option on `docker create` and `docker run`, and takes precedence over
   809  the `--cgroup-parent` option on the daemon.
   810  
   811  ## Daemon configuration file
   812  
   813  The `--config-file` option allows you to set any configuration option
   814  for the daemon in a JSON format. This file uses the same flag names as keys,
   815  except for flags that allow several entries, where it uses the plural
   816  of the flag name, e.g., `labels` for the `label` flag. By default,
   817  docker tries to load a configuration file from `/etc/docker/daemon.json`
   818  on Linux and `%programdata%\docker\config\daemon.json` on Windows.
   819  
   820  The options set in the configuration file must not conflict with options set
   821  via flags. The docker daemon fails to start if an option is duplicated between
   822  the file and the flags, regardless their value. We do this to avoid
   823  silently ignore changes introduced in configuration reloads.
   824  For example, the daemon fails to start if you set daemon labels
   825  in the configuration file and also set daemon labels via the `--label` flag.
   826  
   827  Options that are not present in the file are ignored when the daemon starts.
   828  This is a full example of the allowed configuration options in the file:
   829  
   830  ```json
   831  {
   832  	"authorization-plugins": [],
   833  	"dns": [],
   834  	"dns-opts": [],
   835  	"dns-search": [],
   836  	"exec-opts": [],
   837  	"exec-root": "",
   838  	"storage-driver": "",
   839  	"storage-opts": "",
   840  	"labels": [],
   841  	"log-driver": "",
   842  	"log-opts": [],
   843  	"mtu": 0,
   844  	"pidfile": "",
   845  	"graph": "",
   846  	"cluster-store": "",
   847  	"cluster-store-opts": [],
   848  	"cluster-advertise": "",
   849  	"debug": true,
   850  	"hosts": [],
   851  	"log-level": "",
   852  	"tls": true,
   853  	"tlsverify": true,
   854  	"tlscacert": "",
   855  	"tlscert": "",
   856  	"tlskey": "",
   857  	"api-cors-headers": "",
   858  	"selinux-enabled": false,
   859  	"userns-remap": "",
   860  	"group": "",
   861  	"cgroup-parent": "",
   862  	"default-ulimits": {},
   863         "ipv6": false,
   864         "iptables": false,
   865         "ip-forward": false,
   866         "ip-mask": false,
   867         "userland-proxy": false,
   868         "ip": "0.0.0.0",
   869         "bridge": "",
   870         "bip": "",
   871         "fixed-cidr": "",
   872         "fixed-cidr-v6": "",
   873         "default-gateway": "",
   874         "default-gateway-v6": "",
   875         "icc": false
   876  }
   877  ```
   878  
   879  ### Configuration reloading
   880  
   881  Some options can be reconfigured when the daemon is running without requiring
   882  to restart the process. We use the `SIGHUP` signal in Linux to reload, and a global event
   883  in Windows with the key `Global\docker-daemon-config-$PID`. The options can
   884  be modified in the configuration file but still will check for conflicts with
   885  the provided flags. The daemon fails to reconfigure itself
   886  if there are conflicts, but it won't stop execution.
   887  
   888  The list of currently supported options that can be reconfigured is this:
   889  
   890  - `debug`: it changes the daemon to debug mode when set to true.
   891  - `labels`: it replaces the daemon labels with a new set of labels.