2016-10-14 18:30:36 -04:00
---
title: "dockerd"
description: "The daemon command description and usage"
2016-11-03 18:48:30 -04:00
keywords: "container, daemon, runtime"
2020-02-19 18:19:06 -05:00
redirect_from:
- /engine/reference/commandline/daemon/
2016-10-14 18:30:36 -04:00
---
2015-06-21 16:41:38 -04:00
2017-10-04 13:03:55 -04:00
<!-- This file is maintained within the docker/cli GitHub
2017-07-28 13:28:23 -04:00
repository at https://github.com/docker/cli/. Make all
2016-10-19 13:25:45 -04:00
pull requests against that repo. If you see this file in
another repository, consider it read-only there, as it will
periodically be overwritten by the definitive file. Pull
requests which include edits to this file in other repositories
will be rejected.
-->
2015-06-21 16:41:38 -04:00
# daemon
2016-07-15 19:52:59 -04:00
```markdown
2020-05-04 06:31:31 -04:00
Usage: dockerd COMMAND
2016-07-15 19:52:59 -04:00
A self-sufficient runtime for containers.
Options:
2017-02-14 19:07:50 -05:00
--add-runtime runtime Register an additional OCI compatible runtime (default [])
2020-05-04 06:17:36 -04:00
--allow-nondistributable-artifacts list Allow push of nondistributable artifacts to registry
2016-11-15 14:45:20 -05:00
--api-cors-header string Set CORS headers in the Engine API
2020-05-04 06:17:36 -04:00
--authorization-plugin list Authorization plugins to load
2016-09-25 10:26:46 -04:00
--bip string Specify network bridge IP
-b, --bridge string Attach containers to a network bridge
--cgroup-parent string Set parent cgroup for all containers
--cluster-advertise string Address or interface name to advertise
--cluster-store string URL of the distributed storage backend
2017-02-14 19:07:50 -05:00
--cluster-store-opt map Set cluster store options (default map[])
2016-09-25 10:26:46 -04:00
--config-file string Daemon configuration file (default "/etc/docker/daemon.json")
2020-05-04 06:17:36 -04:00
--containerd string containerd grpc address
2017-02-14 19:07:50 -05:00
--cpu-rt-period int Limit the CPU real-time period in microseconds
--cpu-rt-runtime int Limit the CPU real-time runtime in microseconds
2020-05-04 06:17:36 -04:00
--cri-containerd start containerd with cri
2016-11-22 01:17:24 -05:00
--data-root string Root directory of persistent Docker state (default "/var/lib/docker")
2016-09-25 10:26:46 -04:00
-D, --debug Enable debug mode
2020-05-04 06:17:36 -04:00
--default-address-pool pool-options Default address pools for node specific local networks
2017-02-14 19:07:50 -05:00
--default-gateway ip Container default gateway IPv4 address
--default-gateway-v6 ip Container default gateway IPv6 address
2020-05-04 06:17:36 -04:00
--default-ipc-mode string Default mode for containers ipc ("shareable" | "private") (default "private")
2016-09-25 10:26:46 -04:00
--default-runtime string Default OCI runtime for containers (default "runc")
2020-05-04 06:17:36 -04:00
--default-shm-size bytes Default shm size for containers (default 64MiB)
2017-02-14 19:07:50 -05:00
--default-ulimit ulimit Default ulimits for containers (default [])
2020-05-04 06:17:36 -04:00
--dns list DNS server to use
--dns-opt list DNS options to use
--dns-search list DNS search domains to use
--exec-opt list Runtime execution options
2016-09-25 10:26:46 -04:00
--exec-root string Root directory for execution state files (default "/var/run/docker")
2016-10-06 10:09:54 -04:00
--experimental Enable experimental features
2016-09-25 10:26:46 -04:00
--fixed-cidr string IPv4 subnet for fixed IPs
--fixed-cidr-v6 string IPv6 subnet for fixed IPs
-G, --group string Group for the unix socket (default "docker")
--help Print usage
2020-05-04 06:17:36 -04:00
-H, --host list Daemon socket(s) to connect to
2016-09-25 10:26:46 -04:00
--icc Enable inter-container communication (default true)
--init Run an init in the container to forward signals and reap processes
--init-path string Path to the docker-init binary
2020-05-04 06:17:36 -04:00
--insecure-registry list Enable insecure registry communication
2017-02-14 19:07:50 -05:00
--ip ip Default IP when binding container ports (default 0.0.0.0)
2016-09-25 10:26:46 -04:00
--ip-forward Enable net.ipv4.ip_forward (default true)
--ip-masq Enable IP masquerading (default true)
--iptables Enable addition of iptables rules (default true)
--ipv6 Enable IPv6 networking
2020-05-04 06:17:36 -04:00
--label list Set key=value labels to the daemon
2017-02-14 19:07:50 -05:00
--live-restore Enable live restore of docker when containers are still running
2016-09-25 10:26:46 -04:00
--log-driver string Default driver for container logs (default "json-file")
2020-05-04 06:17:36 -04:00
-l, --log-level string Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info")
2017-02-14 19:07:50 -05:00
--log-opt map Default log driver options for containers (default map[])
2016-09-25 10:26:46 -04:00
--max-concurrent-downloads int Set the max concurrent downloads for each pull (default 3)
--max-concurrent-uploads int Set the max concurrent uploads for each push (default 5)
2017-02-14 19:07:50 -05:00
--metrics-addr string Set default address and port to serve the metrics api on
2016-09-25 10:26:46 -04:00
--mtu int Set the containers network MTU
2020-05-04 06:17:36 -04:00
--network-control-plane-mtu int Network Control plane MTU (default 1500)
2017-05-01 10:15:03 -04:00
--no-new-privileges Set no-new-privileges by default for new containers
2020-05-04 06:17:36 -04:00
--node-generic-resource list Advertise user-defined resource
2016-09-25 10:26:46 -04:00
--oom-score-adjust int Set the oom_score_adj for the daemon (default -500)
-p, --pidfile string Path to use for daemon PID file (default "/var/run/docker.pid")
--raw-logs Full timestamps without ANSI coloring
2020-05-04 06:17:36 -04:00
--registry-mirror list Preferred Docker registry mirror
--rootless Enable rootless mode; typically used with RootlessKit (experimental)
2017-02-14 19:07:50 -05:00
--seccomp-profile string Path to seccomp profile
2016-09-25 10:26:46 -04:00
--selinux-enabled Enable selinux support
2017-02-14 19:07:50 -05:00
--shutdown-timeout int Set the default shutdown timeout (default 15)
2016-09-25 10:26:46 -04:00
-s, --storage-driver string Storage driver to use
2020-05-04 06:17:36 -04:00
--storage-opt list Storage driver options
2016-09-25 10:26:46 -04:00
--swarm-default-advertise-addr string Set default address or interface for swarm advertised address
--tls Use TLS; implied by --tlsverify
2017-02-14 19:07:50 -05:00
--tlscacert string Trust certs signed only by this CA (default "~/.docker/ca.pem")
--tlscert string Path to TLS certificate file (default "~/.docker/cert.pem")
2020-05-04 06:31:31 -04:00
--tlskey string Path to TLS key file (default "~/.docker/key.pem")
2016-09-25 10:26:46 -04:00
--tlsverify Use TLS and verify the remote
--userland-proxy Use userland proxy for loopback traffic (default true)
--userland-proxy-path string Path to the userland proxy binary
--userns-remap string User/Group setting for user namespaces
-v, --version Print version information and quit
2016-07-15 19:52:59 -04:00
```
2015-06-21 16:41:38 -04:00
Options with [] may be specified multiple times.
2017-02-07 18:42:48 -05:00
## Description
`dockerd` is the persistent process that manages containers. Docker
2016-04-28 02:55:22 -04:00
uses different binaries for the daemon and client. To run the daemon you
type `dockerd` .
2015-06-21 16:41:38 -04:00
2017-10-24 05:36:23 -04:00
To run the daemon with debug output, use `dockerd -D` or add `"debug": true` to
2017-02-14 19:07:50 -05:00
the `daemon.json` file.
2020-04-19 11:08:37 -04:00
> **Enabling experimental features**
>
> Enable experimental features by starting `dockerd` with the `--experimental`
> flag or adding `"experimental": true` to the `daemon.json` file.
2015-06-21 16:41:38 -04:00
2018-01-12 12:30:31 -05:00
### Environment variables
For easy reference, the following list of environment variables are supported
by the `dockerd` command line:
* `DOCKER_DRIVER` The graph driver to use.
* `DOCKER_NOWARN_KERNEL_VERSION` Prevent warnings that your Linux kernel is
unsuitable for Docker.
* `DOCKER_RAMDISK` If set this will disable 'pivot_root'.
* `DOCKER_TMPDIR` Location for temporary Docker files.
2018-01-12 12:32:45 -05:00
* `MOBY_DISABLE_PIGZ` Do not use [`unpigz` ](https://linux.die.net/man/1/pigz ) to
decompress layers in parallel when pulling images, even if it is installed.
2018-01-12 12:30:31 -05:00
2017-02-07 18:42:48 -05:00
## Examples
### Daemon socket option
2015-06-21 16:41:38 -04:00
2020-05-25 05:07:10 -04:00
The Docker daemon can listen for [Docker Engine API ](https://docs.docker.com/engine/api/ )
2015-06-21 16:41:38 -04:00
requests via three different types of Socket: `unix` , `tcp` , and `fd` .
By default, a `unix` domain socket (or IPC socket) is created at
`/var/run/docker.sock` , requiring either `root` permission, or `docker` group
membership.
If you need to access the Docker daemon remotely, you need to enable the `tcp`
Socket. Beware that the default setup provides un-encrypted and
un-authenticated direct access to the Docker daemon - and should be secured
2016-10-20 09:52:47 -04:00
either using the [built in HTTPS encrypted socket ](https://docs.docker.com/engine/security/https/ ), or by
2015-06-21 16:41:38 -04:00
putting a secure web proxy in front of it. You can listen on port `2375` on all
network interfaces with `-H tcp://0.0.0.0:2375` , or on a particular network
interface using its IP address: `-H tcp://192.168.59.103:2375` . It is
conventional to use port `2375` for un-encrypted, and port `2376` for encrypted
communication with the daemon.
2020-04-19 11:08:37 -04:00
> **Note**
>
> If you're using an HTTPS encrypted socket, keep in mind that only
2015-06-21 16:41:38 -04:00
> TLS1.0 and greater are supported. Protocols SSLv3 and under are not
> supported anymore for security reasons.
On Systemd based systems, you can communicate with the daemon via
[Systemd socket activation ](http://0pointer.de/blog/projects/socket-activation.html ),
2016-04-28 02:55:22 -04:00
use `dockerd -H fd://` . Using `fd://` will work perfectly for most setups but
you can also specify individual sockets: `dockerd -H fd://3` . If the
2015-06-21 16:41:38 -04:00
specified socket activated files aren't found, then Docker will exit. You can
find examples of using Systemd socket activation with Docker and Systemd in the
[Docker source tree ](https://github.com/docker/docker/tree/master/contrib/init/systemd/ ).
You can configure the Docker daemon to listen to multiple sockets at the same
time using multiple `-H` options:
2016-09-16 11:22:58 -04:00
```bash
# listen using the default unix socket, and on 2 specific IP addresses on this host.
2017-02-07 18:42:48 -05:00
2016-09-16 11:22:58 -04:00
$ sudo dockerd -H unix:///var/run/docker.sock -H tcp://192.168.59.106 -H tcp://10.10.10.2
```
2015-06-21 16:41:38 -04:00
The Docker client will honor the `DOCKER_HOST` environment variable to set the
2017-02-07 18:42:48 -05:00
`-H` flag for the client. Use **one** of the following commands:
2015-06-21 16:41:38 -04:00
2016-09-16 11:22:58 -04:00
```bash
$ docker -H tcp://0.0.0.0:2375 ps
2017-02-07 18:42:48 -05:00
```
```bash
2016-09-16 11:22:58 -04:00
$ export DOCKER_HOST="tcp://0.0.0.0:2375"
2017-02-07 18:42:48 -05:00
2016-09-16 11:22:58 -04:00
$ docker ps
```
2015-06-21 16:41:38 -04:00
Setting the `DOCKER_TLS_VERIFY` environment variable to any value other than
the empty string is equivalent to setting the `--tlsverify` flag. The following
are equivalent:
2016-09-16 11:22:58 -04:00
```bash
$ docker --tlsverify ps
# or
$ export DOCKER_TLS_VERIFY=1
$ docker ps
```
2015-06-21 16:41:38 -04:00
The Docker client will honor the `HTTP_PROXY` , `HTTPS_PROXY` , and `NO_PROXY`
environment variables (or the lowercase versions thereof). `HTTPS_PROXY` takes
precedence over `HTTP_PROXY` .
2018-02-19 04:31:29 -05:00
Starting with Docker 18.09, the Docker client supports connecting to a remote
daemon via SSH:
```
$ docker -H ssh://me@example.com:22 ps
$ docker -H ssh://me@example.com ps
$ docker -H ssh://example.com ps
```
To use SSH connection, you need to set up `ssh` so that it can reach the
2018-10-25 03:02:26 -04:00
remote host with public key authentication. Password authentication is not
supported. If your key is protected with passphrase, you need to set up
`ssh-agent` .
2018-02-19 04:31:29 -05:00
Also, you need to have `docker` binary 18.09 or later on the daemon host.
2017-02-07 18:42:48 -05:00
#### Bind Docker to another host/port or a Unix socket
2016-06-07 20:42:00 -04:00
> **Warning**:
> Changing the default `docker` daemon binding to a
> TCP port or Unix *docker* user group will increase your security risks
> by allowing non-root users to gain *root* access on the host. Make sure
> you control access to `docker`. If you are binding
> to a TCP port, anyone with access to that port has full Docker access;
> so it is not advisable on an open network.
With `-H` it is possible to make the Docker daemon to listen on a
specific IP and port. By default, it will listen on
`unix:///var/run/docker.sock` to allow only local connections by the
*root* user. You *could* set it to `0.0.0.0:2375` or a specific host IP
to give access to everybody, but that is **not recommended** because
then it is trivial for someone to gain root access to the host where the
daemon is running.
Similarly, the Docker client can use `-H` to connect to a custom port.
The Docker client will default to connecting to `unix:///var/run/docker.sock`
on Linux, and `tcp://127.0.0.1:2376` on Windows.
`-H` accepts host and port assignment in the following format:
tcp://[host]:[port][path] or unix://path
For example:
- `tcp://` -> TCP connection to `127.0.0.1` on either port `2376` when TLS encryption
is on, or port `2375` when communication is in plain text.
- `tcp://host:2375` -> TCP connection on
host:2375
- `tcp://host:2375/path` -> TCP connection on
host:2375 and prepend path to all requests
- `unix://path/to/socket` -> Unix socket located
at `path/to/socket`
`-H` , when empty, will default to the same value as
when no `-H` was passed in.
2016-09-16 11:22:58 -04:00
`-H` also accepts short form for TCP bindings: `host:` or `host:port` or `:port`
2016-06-07 20:42:00 -04:00
Run Docker in daemon mode:
2016-09-16 11:22:58 -04:00
```bash
$ sudo < path to > /dockerd -H 0.0.0.0:5555 &
```
2016-06-07 20:42:00 -04:00
Download an `ubuntu` image:
2016-09-16 11:22:58 -04:00
```bash
$ docker -H :5555 pull ubuntu
```
2016-06-07 20:42:00 -04:00
You can use multiple `-H` , for example, if you want to listen on both
TCP and a Unix socket
2016-09-16 11:22:58 -04:00
```bash
# Run docker in daemon mode
$ sudo < path to > /dockerd -H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock &
# Download an ubuntu image, use default Unix socket
$ docker pull ubuntu
# OR use the TCP port
$ docker -H tcp://127.0.0.1:2375 pull ubuntu
```
2016-06-07 20:42:00 -04:00
2017-02-07 18:42:48 -05:00
### Daemon storage-driver
2015-06-21 16:41:38 -04:00
2017-08-15 13:02:33 -04:00
On Linux, the Docker daemon has support for several different image layer storage
2016-06-13 14:06:47 -04:00
drivers: `aufs` , `devicemapper` , `btrfs` , `zfs` , `overlay` and `overlay2` .
2015-06-21 16:41:38 -04:00
The `aufs` driver is the oldest, but is based on a Linux kernel patch-set that
is unlikely to be merged into the main kernel. These are also known to cause
2016-12-25 23:49:37 -05:00
some serious kernel crashes. However `aufs` allows containers to share
2016-07-15 01:57:38 -04:00
executable and shared library memory, so is a useful choice when running
thousands of containers with the same program or libraries.
2015-06-21 16:41:38 -04:00
The `devicemapper` driver uses thin provisioning and Copy on Write (CoW)
snapshots. For each devicemapper graph location – typically
`/var/lib/docker/devicemapper` – a thin pool is created based on two block
devices, one for data and one for metadata. By default, these block devices
are created automatically by using loopback mounts of automatically created
2017-12-12 20:27:05 -05:00
sparse files. Refer to [Devicemapper options ](#devicemapper-options ) below
2015-06-21 16:41:38 -04:00
for a way how to customize this setup.
[~jpetazzo/Resizing Docker containers with the Device Mapper plugin ](http://jpetazzo.github.io/2014/01/29/docker-device-mapper-resize/ )
article explains how to tune your existing setup without the use of options.
The `btrfs` driver is very fast for `docker build` - but like `devicemapper`
does not share executable memory between devices. Use
2016-04-28 02:55:22 -04:00
`dockerd -s btrfs -g /mnt/btrfs_partition` .
2015-06-21 16:41:38 -04:00
2015-12-29 17:06:02 -05:00
The `zfs` driver is probably not as fast as `btrfs` but has a longer track record
2015-06-21 16:41:38 -04:00
on stability. Thanks to `Single Copy ARC` shared blocks between clones will be
2016-04-28 02:55:22 -04:00
cached only once. Use `dockerd -s zfs` . To select a different zfs filesystem
2017-12-12 20:27:05 -05:00
set `zfs.fsname` option as described in [ZFS options ](#zfs-options ).
2015-06-21 16:41:38 -04:00
The `overlay` is a very fast union filesystem. It is now merged in the main
2016-07-15 01:57:38 -04:00
Linux kernel as of [3.18.0 ](https://lkml.org/lkml/2014/10/26/137 ). `overlay`
also supports page cache sharing, this means multiple containers accessing
the same file can share a single page cache entry (or entries), it makes
2020-04-19 11:08:37 -04:00
`overlay` as efficient with memory as `aufs` driver. Call `dockerd -s overlay`
to use it.
2015-06-21 16:41:38 -04:00
2016-06-13 14:06:47 -04:00
The `overlay2` uses the same fast union filesystem but takes advantage of
[additional features ](https://lkml.org/lkml/2015/2/11/106 ) added in Linux
kernel 4.0 to avoid excessive inode consumption. Call `dockerd -s overlay2`
to use it.
2020-04-19 11:08:37 -04:00
> **Note**
>
> The `overlay` storage driver can cause excessive inode consumption (especially
> as the number of images grows). We recommend using the `overlay2` storage
> driver instead.
> **Note**
>
> Both `overlay` and `overlay2` are currently unsupported on `btrfs`
2017-02-07 18:42:48 -05:00
> or any Copy on Write filesystem and should only be used over `ext4` partitions.
2015-06-21 16:41:38 -04:00
2017-08-15 13:02:33 -04:00
On Windows, the Docker daemon supports a single image layer storage driver
depending on the image platform: `windowsfilter` for Windows images, and
`lcow` for Linux containers on Windows.
2017-02-07 18:42:48 -05:00
### Options per storage driver
2015-06-21 16:41:38 -04:00
Particular storage-driver can be configured with options specified with
2016-03-23 21:14:38 -04:00
`--storage-opt` flags. Options for `devicemapper` are prefixed with `dm` ,
2017-08-15 13:02:33 -04:00
options for `zfs` start with `zfs` , options for `btrfs` start with `btrfs`
and options for `lcow` start with `lcow` .
2016-03-23 21:14:38 -04:00
#### Devicemapper options
2015-06-21 16:41:38 -04:00
2017-04-19 17:35:04 -04:00
This is an example of the configuration file for devicemapper on Linux:
```json
{
"storage-driver": "devicemapper",
"storage-opts": [
"dm.thinpooldev=/dev/mapper/thin-pool",
"dm.use_deferred_deletion=true",
"dm.use_deferred_removal=true"
2017-04-20 22:26:12 -04:00
]
2017-04-19 17:35:04 -04:00
}
```
2017-02-07 18:42:48 -05:00
##### `dm.thinpooldev`
2015-06-28 23:04:24 -04:00
2017-02-07 18:42:48 -05:00
Specifies a custom block storage device to use for the thin pool.
2015-06-28 23:04:24 -04:00
2017-02-07 18:42:48 -05:00
If using a block device for device mapper storage, it is best to use `lvm`
to create and manage the thin-pool volume. This volume is then handed to Docker
to exclusively create snapshot volumes needed for images and containers.
2015-06-28 23:04:24 -04:00
2017-02-07 18:42:48 -05:00
Managing the thin-pool outside of Engine makes for the most feature-rich
method of having Docker utilize device mapper thin provisioning as the
backing storage for Docker containers. The highlights of the lvm-based
thin-pool management feature include: automatic or interactive thin-pool
resize support, dynamically changing thin-pool features, automatic thinp
metadata checking when lvm activates the thin-pool, etc.
2015-06-28 23:04:24 -04:00
2017-02-07 18:42:48 -05:00
As a fallback if no thin pool is provided, loopback files are
created. Loopback is very slow, but can be used without any
pre-configuration of storage. It is strongly recommended that you do
not use loopback in production. Ensure your Engine daemon has a
`--storage-opt dm.thinpooldev` argument provided.
2015-08-04 14:33:00 -04:00
2017-02-07 18:42:48 -05:00
###### Example:
2015-06-28 23:04:24 -04:00
2017-02-07 18:42:48 -05:00
```bash
$ sudo dockerd --storage-opt dm.thinpooldev=/dev/mapper/thin-pool
```
2015-06-21 16:41:38 -04:00
2017-02-16 15:33:03 -05:00
##### `dm.directlvm_device`
As an alternative to providing a thin pool as above, Docker can setup a block
device for you.
###### Example:
```bash
$ sudo dockerd --storage-opt dm.directlvm_device=/dev/xvdf
```
##### `dm.thinp_percent`
Sets the percentage of passed in block device to use for storage.
###### Example:
```bash
$ sudo dockerd --storage-opt dm.thinp_percent=95
```
##### `dm.thinp_metapercent`
Sets the percentage of the passed in block device to use for metadata storage.
###### Example:
```bash
$ sudo dockerd --storage-opt dm.thinp_metapercent=1
```
##### `dm.thinp_autoextend_threshold`
Sets the value of the percentage of space used before `lvm` attempts to
autoextend the available space [100 = disabled]
###### Example:
```bash
$ sudo dockerd --storage-opt dm.thinp_autoextend_threshold=80
```
##### `dm.thinp_autoextend_percent`
2017-10-31 06:21:09 -04:00
Sets the value percentage value to increase the thin pool by when `lvm`
2017-02-16 15:33:03 -05:00
attempts to autoextend the available space [100 = disabled]
###### Example:
```bash
$ sudo dockerd --storage-opt dm.thinp_autoextend_percent=20
```
2017-02-07 18:42:48 -05:00
##### `dm.basesize`
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
Specifies the size to use when creating the base device, which limits the
size of images and containers. The default value is 10G. Note, thin devices
are inherently "sparse", so a 10G device which is mostly empty doesn't use
10 GB of space on the pool. However, the filesystem will use more space for
the empty case the larger the device is.
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
The base device size can be increased at daemon restart which will allow
all future images and containers (based on those new images) to be of the
new base device size.
2016-01-12 13:44:13 -05:00
2017-02-07 18:42:48 -05:00
###### Examples
2016-01-12 13:44:13 -05:00
2017-02-07 18:42:48 -05:00
```bash
$ sudo dockerd --storage-opt dm.basesize=50G
```
2016-09-16 11:22:58 -04:00
2017-02-07 18:42:48 -05:00
This will increase the base device size to 50G. The Docker daemon will throw an
error if existing base device size is larger than 50G. A user can use
this option to expand the base device size however shrinking is not permitted.
2016-01-12 13:44:13 -05:00
2017-02-07 18:42:48 -05:00
This value affects the system-wide "base" empty filesystem
that may already be initialized and inherited by pulled images. Typically,
a change to this value requires additional steps to take effect:
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
```bash
$ sudo service docker stop
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
$ sudo rm -rf /var/lib/docker
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
$ sudo service docker start
```
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
##### `dm.loopdatasize`
2015-10-06 18:45:32 -04:00
2020-04-19 11:08:37 -04:00
> **Note**
>
> This option configures devicemapper loopback, which should not
2017-02-07 18:42:48 -05:00
> be used in production.
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
Specifies the size to use when creating the loopback file for the
"data" device which is used for the thin pool. The default size is
100G. The file is sparse, so it will not initially take up this
much space.
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
###### Example
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
```bash
$ sudo dockerd --storage-opt dm.loopdatasize=200G
```
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
##### `dm.loopmetadatasize`
2015-06-28 23:04:24 -04:00
2020-04-19 11:08:37 -04:00
> **Note**
>
> This option configures devicemapper loopback, which should not
2017-02-07 18:42:48 -05:00
> be used in production.
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
Specifies the size to use when creating the loopback file for the
"metadata" device which is used for the thin pool. The default size
is 2G. The file is sparse, so it will not initially take up
this much space.
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
###### Example
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
```bash
$ sudo dockerd --storage-opt dm.loopmetadatasize=4G
```
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
##### `dm.fs`
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
Specifies the filesystem type to use for the base device. The supported
options are "ext4" and "xfs". The default is "xfs"
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
###### Example
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
```bash
$ sudo dockerd --storage-opt dm.fs=ext4
```
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
##### `dm.mkfsarg`
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
Specifies extra mkfs arguments to be used when creating the base device.
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
###### Example
```bash
$ sudo dockerd --storage-opt "dm.mkfsarg=-O ^has_journal"
```
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
##### `dm.mountopt`
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
Specifies extra mount options used when mounting the thin devices.
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
###### Example
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
```bash
$ sudo dockerd --storage-opt dm.mountopt=nodiscard
```
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
##### `dm.datadev`
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
(Deprecated, use `dm.thinpooldev` )
2015-06-28 23:04:24 -04:00
2017-02-07 18:42:48 -05:00
Specifies a custom blockdevice to use for data for the thin pool.
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
If using a block device for device mapper storage, ideally both `datadev` and
`metadatadev` should be specified to completely avoid using the loopback
device.
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
###### Example
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
```bash
$ sudo dockerd \
--storage-opt dm.datadev=/dev/sdb1 \
--storage-opt dm.metadatadev=/dev/sdc1
```
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
##### `dm.metadatadev`
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
(Deprecated, use `dm.thinpooldev` )
2015-06-28 23:04:24 -04:00
2017-02-07 18:42:48 -05:00
Specifies a custom blockdevice to use for metadata for the thin pool.
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
For best performance the metadata should be on a different spindle than the
data, or even better on an SSD.
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
If setting up a new metadata pool it is required to be valid. This can be
achieved by zeroing the first 4k to indicate empty metadata, like this:
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
```bash
$ dd if=/dev/zero of=$metadata_dev bs=4096 count=1
```
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
###### Example
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
```bash
$ sudo dockerd \
--storage-opt dm.datadev=/dev/sdb1 \
--storage-opt dm.metadatadev=/dev/sdc1
```
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
##### `dm.blocksize`
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
Specifies a custom blocksize to use for the thin pool. The default
blocksize is 64K.
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
###### Example
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
```bash
$ sudo dockerd --storage-opt dm.blocksize=512K
```
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
##### `dm.blkdiscard`
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
Enables or disables the use of `blkdiscard` when removing devicemapper
devices. This is enabled by default (only) if using loopback devices and is
required to resparsify the loopback file on image/container removal.
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
Disabling this on loopback can lead to *much* faster container removal
times, but will make the space used in `/var/lib/docker` directory not be
returned to the system for other use when containers are removed.
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
###### Examples
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
```bash
$ sudo dockerd --storage-opt dm.blkdiscard=false
```
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
##### `dm.override_udev_sync_check`
2015-07-07 15:27:19 -04:00
2017-02-07 18:42:48 -05:00
Overrides the `udev` synchronization checks between `devicemapper` and `udev` .
`udev` is the device manager for the Linux kernel.
2015-07-07 15:27:19 -04:00
2017-02-07 18:42:48 -05:00
To view the `udev` sync support of a Docker daemon that is using the
`devicemapper` driver, run:
2015-07-07 15:27:19 -04:00
2017-02-07 18:42:48 -05:00
```bash
$ docker info
[...]
Udev Sync Supported: true
[...]
```
2015-07-07 15:27:19 -04:00
2017-02-07 18:42:48 -05:00
When `udev` sync support is `true` , then `devicemapper` and udev can
coordinate the activation and deactivation of devices for containers.
2015-07-07 15:27:19 -04:00
2017-02-07 18:42:48 -05:00
When `udev` sync support is `false` , a race condition occurs between
the`devicemapper` and `udev` during create and cleanup. The race condition
results in errors and failures. (For information on these failures, see
[docker#4036 ](https://github.com/docker/docker/issues/4036 ))
2015-07-07 15:27:19 -04:00
2017-02-07 18:42:48 -05:00
To allow the `docker` daemon to start, regardless of `udev` sync not being
supported, set `dm.override_udev_sync_check` to true:
2015-07-07 15:27:19 -04:00
2017-02-07 18:42:48 -05:00
```bash
$ sudo dockerd --storage-opt dm.override_udev_sync_check=true
```
2015-07-07 15:27:19 -04:00
2017-02-07 18:42:48 -05:00
When this value is `true` , the `devicemapper` continues and simply warns
you the errors are happening.
2015-07-07 15:27:19 -04:00
2020-04-19 11:08:37 -04:00
> **Note**
>
> The ideal is to pursue a `docker` daemon and environment that does
2017-02-07 18:42:48 -05:00
> support synchronizing with `udev`. For further discussion on this
> topic, see [docker#4036](https://github.com/docker/docker/issues/4036).
> Otherwise, set this flag for migrating existing Docker daemons to
> a daemon with a supported environment.
2015-07-07 15:27:19 -04:00
2017-02-07 18:42:48 -05:00
##### `dm.use_deferred_removal`
2015-10-06 17:37:21 -04:00
2017-02-07 18:42:48 -05:00
Enables use of deferred device removal if `libdm` and the kernel driver
support the mechanism.
2015-10-06 17:37:21 -04:00
2017-02-07 18:42:48 -05:00
Deferred device removal means that if device is busy when devices are
being removed/deactivated, then a deferred removal is scheduled on
device. And devices automatically go away when last user of the device
exits.
2015-10-06 17:37:21 -04:00
2017-02-07 18:42:48 -05:00
For example, when a container exits, its associated thin device is removed.
If that device has leaked into some other mount namespace and can't be
removed, the container exit still succeeds and this option causes the
system to schedule the device for deferred removal. It does not wait in a
loop trying to remove a busy device.
2015-10-06 17:37:21 -04:00
2017-02-07 18:42:48 -05:00
###### Example
2015-10-17 22:06:21 -04:00
2017-02-07 18:42:48 -05:00
```bash
$ sudo dockerd --storage-opt dm.use_deferred_removal=true
```
2015-10-06 17:37:21 -04:00
2017-02-07 18:42:48 -05:00
##### `dm.use_deferred_deletion`
2015-10-06 17:37:21 -04:00
2017-02-07 18:42:48 -05:00
Enables use of deferred device deletion for thin pool devices. By default,
thin pool device deletion is synchronous. Before a container is deleted,
the Docker daemon removes any associated devices. If the storage driver
can not remove a device, the container deletion fails and daemon returns.
2015-10-06 17:37:21 -04:00
2020-05-11 11:32:52 -04:00
```console
2017-02-07 18:42:48 -05:00
Error deleting container: Error response from daemon: Cannot destroy container
```
2015-10-06 17:37:21 -04:00
2017-02-07 18:42:48 -05:00
To avoid this failure, enable both deferred device deletion and deferred
device removal on the daemon.
2015-10-06 17:37:21 -04:00
2017-02-07 18:42:48 -05:00
```bash
$ sudo dockerd \
--storage-opt dm.use_deferred_deletion=true \
--storage-opt dm.use_deferred_removal=true
```
2015-10-06 17:37:21 -04:00
2017-02-07 18:42:48 -05:00
With these two options enabled, if a device is busy when the driver is
deleting a container, the driver marks the device as deleted. Later, when
the device isn't in use, the driver deletes it.
2015-10-06 17:37:21 -04:00
2017-02-07 18:42:48 -05:00
In general it should be safe to enable this option by default. It will help
when unintentional leaking of mount point happens across multiple mount
namespaces.
2015-10-06 17:37:21 -04:00
2017-02-07 18:42:48 -05:00
##### `dm.min_free_space`
2016-03-07 15:27:39 -05:00
2017-02-07 18:42:48 -05:00
Specifies the min free space percent in a thin pool require for new device
creation to succeed. This check applies to both free data space as well
as free metadata space. Valid values are from 0% - 99%. Value 0% disables
free space checking logic. If user does not specify a value for this option,
the Engine uses a default value of 10%.
2016-03-07 15:27:39 -05:00
2017-02-07 18:42:48 -05:00
Whenever a new a thin pool device is created (during `docker pull` or during
container creation), the Engine checks if the minimum free space is
available. If sufficient space is unavailable, then device creation fails
and any relevant `docker` operation fails.
2016-03-07 15:27:39 -05:00
2017-02-07 18:42:48 -05:00
To recover from this error, you must create more free space in the thin pool
to recover from the error. You can create free space by deleting some images
and containers from the thin pool. You can also add more storage to the thin
pool.
2016-03-07 15:27:39 -05:00
2017-02-07 18:42:48 -05:00
To add more space to a LVM (logical volume management) thin pool, just add
more storage to the volume group container thin pool; this should automatically
resolve any errors. If your configuration uses loop devices, then stop the
Engine daemon, grow the size of loop files and restart the daemon to resolve
the issue.
2016-03-07 15:27:39 -05:00
2017-02-07 18:42:48 -05:00
###### Example
2016-03-07 15:27:39 -05:00
2017-02-07 18:42:48 -05:00
```bash
$ sudo dockerd --storage-opt dm.min_free_space=10%
```
2016-03-07 15:27:39 -05:00
2017-02-07 18:42:48 -05:00
##### `dm.xfs_nospace_max_retries`
2016-08-31 10:13:04 -04:00
2017-02-07 18:42:48 -05:00
Specifies the maximum number of retries XFS should attempt to complete
IO when ENOSPC (no space) error is returned by underlying storage device.
2016-08-31 10:13:04 -04:00
2017-02-07 18:42:48 -05:00
By default XFS retries infinitely for IO to finish and this can result
in unkillable process. To change this behavior one can set
xfs_nospace_max_retries to say 0 and XFS will not retry IO after getting
ENOSPC and will shutdown filesystem.
2016-08-31 10:13:04 -04:00
2017-02-07 18:42:48 -05:00
###### Example
2016-08-31 10:13:04 -04:00
2017-02-07 18:42:48 -05:00
```bash
$ sudo dockerd --storage-opt dm.xfs_nospace_max_retries=0
```
2016-08-31 10:13:04 -04:00
2017-07-12 10:38:47 -04:00
##### `dm.libdm_log_level`
Specifies the maxmimum `libdm` log level that will be forwarded to the
`dockerd` log (as specified by `--log-level` ). This option is primarily
intended for debugging problems involving `libdm` . Using values other than the
defaults may cause false-positive warnings to be logged.
Values specified must fall within the range of valid `libdm` log levels. At the
time of writing, the following is the list of `libdm` log levels as well as
their corresponding levels when output by `dockerd` .
| `libdm` Level | Value | `--log-level` |
| ------------- | -----:| ------------- |
| `_LOG_FATAL` | 2 | error |
| `_LOG_ERR` | 3 | error |
| `_LOG_WARN` | 4 | warn |
| `_LOG_NOTICE` | 5 | info |
| `_LOG_INFO` | 6 | info |
| `_LOG_DEBUG` | 7 | debug |
###### Example
```bash
$ sudo dockerd \
--log-level debug \
--storage-opt dm.libdm_log_level=7
```
2016-03-23 21:14:38 -04:00
#### ZFS options
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
##### `zfs.fsname`
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
Set zfs filesystem under which docker will create its own datasets.
By default docker will pick up the zfs filesystem where docker graph
(`/var/lib/docker`) is located.
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
###### Example
2015-06-21 16:41:38 -04:00
2017-02-07 18:42:48 -05:00
```bash
$ sudo dockerd -s zfs --storage-opt zfs.fsname=zroot/docker
```
2015-06-21 16:41:38 -04:00
2016-03-23 21:14:38 -04:00
#### Btrfs options
2017-02-07 18:42:48 -05:00
##### `btrfs.min_space`
2016-03-23 21:14:38 -04:00
2017-02-07 18:42:48 -05:00
Specifies the minimum size to use when creating the subvolume which is used
for containers. If user uses disk quota for btrfs when creating or running
a container with ** --storage-opt size** option, docker should ensure the
**size** cannot be smaller than **btrfs.min_space** .
2016-03-23 21:14:38 -04:00
2017-02-07 18:42:48 -05:00
###### Example
2016-09-16 11:22:58 -04:00
2017-02-07 18:42:48 -05:00
```bash
$ sudo dockerd -s btrfs --storage-opt btrfs.min_space=10G
```
2016-03-23 21:14:38 -04:00
2016-07-11 19:48:08 -04:00
#### Overlay2 options
2017-02-07 18:42:48 -05:00
##### `overlay2.override_kernel_check`
2016-07-11 19:48:08 -04:00
2017-02-07 18:42:48 -05:00
Overrides the Linux kernel version check allowing overlay2. Support for
specifying multiple lower directories needed by overlay2 was added to the
Linux kernel in 4.0.0. However, some older kernel versions may be patched
to add multiple lower directory support for OverlayFS. This option should
only be used after verifying this support exists in the kernel. Applying
this option on a kernel without this support will cause failures on mount.
2016-07-11 19:48:08 -04:00
2017-06-20 16:53:09 -04:00
##### `overlay2.size`
Sets the default max size of the container. It is supported only when the
backing fs is `xfs` and mounted with `pquota` mount option. Under these
conditions the user can pass any size less then the backing fs size.
###### Example
```bash
$ sudo dockerd -s overlay2 --storage-opt overlay2.size=1G
```
2017-08-15 13:02:33 -04:00
#### Windowsfilter options
##### `size`
Specifies the size to use when creating the sandbox which is used for containers.
Defaults to 20G.
###### Example
2019-05-13 19:37:30 -04:00
```powershell
2017-08-15 13:02:33 -04:00
C:\> dockerd --storage-opt size=40G
```
#### LCOW (Linux Containers on Windows) options
##### `lcow.globalmode`
2020-03-15 10:11:43 -04:00
Specifies whether the daemon instantiates utility VM instances as required
2017-08-15 13:02:33 -04:00
(recommended and default if omitted), or uses single global utility VM (better
performance, but has security implications and not recommended for production
deployments).
###### Example
2019-05-13 19:37:30 -04:00
```powershell
2017-08-15 13:02:33 -04:00
C:\> dockerd --storage-opt lcow.globalmode=false
```
##### `lcow.kirdpath`
Specifies the folder path to the location of a pair of kernel and initrd files
used for booting a utility VM. Defaults to `%ProgramFiles%\Linux Containers` .
###### Example
2019-05-13 19:37:30 -04:00
```powershell
2017-08-15 13:02:33 -04:00
C:\> dockerd --storage-opt lcow.kirdpath=c:\path\to\files
```
##### `lcow.kernel`
Specifies the filename of a kernel file located in the `lcow.kirdpath` path.
Defaults to `bootx64.efi` .
###### Example
2019-05-13 19:37:30 -04:00
```powershell
2017-08-15 13:02:33 -04:00
C:\> dockerd --storage-opt lcow.kernel=kernel.efi
```
##### `lcow.initrd`
Specifies the filename of an initrd file located in the `lcow.kirdpath` path.
Defaults to `initrd.img` .
###### Example
2019-05-13 19:37:30 -04:00
```powershell
2017-08-15 13:02:33 -04:00
C:\> dockerd --storage-opt lcow.initrd=myinitrd.img
```
##### `lcow.bootparameters`
Specifies additional boot parameters for booting utility VMs when in kernel/
initrd mode. Ignored if the utility VM is booting from VHD. These settings
are kernel specific.
###### Example
2019-05-13 19:37:30 -04:00
```powershell
2017-08-15 13:02:33 -04:00
C:\> dockerd --storage-opt "lcow.bootparameters='option=value'"
```
##### `lcow.vhdx`
Specifies a custom VHDX to boot a utility VM, as an alternate to kernel
and initrd booting. Defaults to `uvm.vhdx` under `lcow.kirdpath` .
###### Example
2019-05-13 19:37:30 -04:00
```powershell
2017-08-15 13:02:33 -04:00
C:\> dockerd --storage-opt lcow.vhdx=custom.vhdx
```
##### `lcow.timeout`
Specifies the timeout for utility VM operations in seconds. Defaults
to 300.
###### Example
2019-05-13 19:37:30 -04:00
```powershell
2017-08-15 13:02:33 -04:00
C:\> dockerd --storage-opt lcow.timeout=240
```
##### `lcow.sandboxsize`
Specifies the size in GB to use when creating the sandbox which is used for
containers. Defaults to 20. Cannot be less than 20.
###### Example
2019-05-13 19:37:30 -04:00
```powershell
2017-08-15 13:02:33 -04:00
C:\> dockerd --storage-opt lcow.sandboxsize=40
```
2017-02-07 18:42:48 -05:00
### Docker runtime execution options
2015-06-30 20:33:04 -04:00
2016-03-18 15:43:17 -04:00
The Docker daemon relies on a
2016-08-17 12:38:34 -04:00
[OCI ](https://github.com/opencontainers/runtime-spec ) compliant runtime
2016-03-18 15:43:17 -04:00
(invoked via the `containerd` daemon) as its interface to the Linux
kernel `namespaces` , `cgroups` , and `SELinux` .
2015-06-21 16:41:38 -04:00
2016-08-29 04:00:52 -04:00
By default, the Docker daemon automatically starts `containerd` . If you want to
control `containerd` startup, manually start `containerd` and pass the path to
the `containerd` socket using the `--containerd` flag. For example:
```bash
2016-09-16 11:22:58 -04:00
$ sudo dockerd --containerd /var/run/dev/docker-containerd.sock
2016-08-29 04:00:52 -04:00
```
2016-05-23 17:49:50 -04:00
Runtimes can be registered with the daemon either via the
configuration file or using the `--add-runtime` command line argument.
The following is an example adding 2 runtimes via the configuration:
2016-10-19 13:25:45 -04:00
2016-05-23 17:49:50 -04:00
` ``json
2016-12-17 09:01:59 -05:00
{
"default-runtime": "runc",
"runtimes": {
"runc": {
"path": "runc"
},
"custom": {
"path": "/usr/local/bin/my-runc-replacement",
"runtimeArgs": [
"--debug"
]
}
2016-05-23 17:49:50 -04:00
}
2016-10-19 13:25:45 -04:00
}
2016-05-23 17:49:50 -04:00
```
This is the same example via the command line:
2016-09-16 11:22:58 -04:00
```bash
$ sudo dockerd --add-runtime runc=runc --add-runtime custom=/usr/local/bin/my-runc-replacement
```
2016-05-23 17:49:50 -04:00
2020-04-19 11:08:37 -04:00
> **Note**
>
> Defining runtime arguments via the command line is not supported.
2016-05-23 17:49:50 -04:00
2017-02-07 18:42:48 -05:00
#### Options for the runtime
2015-06-21 16:41:38 -04:00
2016-03-18 15:43:17 -04:00
You can configure the runtime using options specified
2015-06-21 16:41:38 -04:00
with the `--exec-opt` flag. All the flag's options have the `native` prefix. A
single `native.cgroupdriver` option is available.
The `native.cgroupdriver` option specifies the management of the container's
2016-12-26 09:27:56 -05:00
cgroups. You can only specify `cgroupfs` or `systemd` . If you specify
2016-03-24 12:18:03 -04:00
`systemd` and it is not available, the system errors out. If you omit the
2015-11-04 16:51:46 -05:00
`native.cgroupdriver` option,` cgroupfs` is used.
2015-06-21 16:41:38 -04:00
2016-03-24 12:18:03 -04:00
This example sets the `cgroupdriver` to `systemd` :
2016-03-18 15:43:17 -04:00
2016-09-16 11:22:58 -04:00
```bash
$ sudo dockerd --exec-opt native.cgroupdriver=systemd
```
2015-06-21 16:41:38 -04:00
Setting this option applies to all containers the daemon launches.
2015-11-09 04:11:10 -05:00
Also Windows Container makes use of `--exec-opt` for special purpose. Docker user
can specify default container isolation technology with this, for example:
2016-12-26 09:27:56 -05:00
```console
> dockerd --exec-opt isolation=hyperv
2016-09-16 11:22:58 -04:00
```
2015-11-09 04:11:10 -05:00
2016-04-14 20:12:02 -04:00
Will make `hyperv` the default isolation technology on Windows. If no isolation
value is specified on daemon start, on Windows client, the default is
2016-06-07 20:42:00 -04:00
`hyperv` , and on Windows server, the default is `process` .
2015-11-09 04:11:10 -05:00
2017-10-04 12:09:12 -04:00
### Daemon DNS options
2015-06-21 16:41:38 -04:00
2016-09-16 11:22:58 -04:00
To set the DNS server for all Docker containers, use:
```bash
$ sudo dockerd --dns 8.8.8.8
```
To set the DNS search domain for all Docker containers, use:
```bash
$ sudo dockerd --dns-search example.com
```
2015-06-21 16:41:38 -04:00
2017-10-04 12:09:12 -04:00
### Allow push of nondistributable artifacts
2017-05-09 17:00:31 -04:00
Some images (e.g., Windows base images) contain artifacts whose distribution is
restricted by license. When these images are pushed to a registry, restricted
artifacts are not included.
To override this behavior for specific registries, use the
`--allow-nondistributable-artifacts` option in one of the following forms:
* `--allow-nondistributable-artifacts myregistry:5000` tells the Docker daemon
to push nondistributable artifacts to myregistry:5000.
* `--allow-nondistributable-artifacts 10.1.0.0/16` tells the Docker daemon to
push nondistributable artifacts to all registries whose resolved IP address
is within the subnet described by the CIDR syntax.
This option can be used multiple times.
This option is useful when pushing images containing nondistributable artifacts
to a registry on an air-gapped network so hosts on that network can pull the
images without connecting to another server.
> **Warning**: Nondistributable artifacts typically have restrictions on how
> and where they can be distributed and shared. Only use this feature to push
> artifacts to private registries and ensure that you are in compliance with
> any terms that cover redistributing nondistributable artifacts.
2017-10-04 12:09:12 -04:00
### Insecure registries
2015-06-21 16:41:38 -04:00
Docker considers a private registry either secure or insecure. In the rest of
this section, *registry* is used for *private registry* , and `myregistry:5000`
is a placeholder example for a private registry.
A secure registry uses TLS and a copy of its CA certificate is placed on the
Docker host at `/etc/docker/certs.d/myregistry:5000/ca.crt` . An insecure
registry is either not using TLS (i.e., listening on plain text HTTP), or is
using TLS with a CA certificate not known by the Docker daemon. The latter can
happen when the certificate was not found under
`/etc/docker/certs.d/myregistry:5000/` , or if the certificate verification
failed (i.e., wrong CA).
By default, Docker assumes all, but local (see local registries below),
registries are secure. Communicating with an insecure registry is not possible
if Docker assumes that registry is secure. In order to communicate with an
insecure registry, the Docker daemon requires `--insecure-registry` in one of
the following two forms:
* `--insecure-registry myregistry:5000` tells the Docker daemon that
myregistry:5000 should be considered insecure.
* `--insecure-registry 10.1.0.0/16` tells the Docker daemon that all registries
whose domain resolve to an IP address is part of the subnet described by the
CIDR syntax, should be considered insecure.
The flag can be used multiple times to allow multiple registries to be marked
as insecure.
If an insecure registry is not marked as insecure, `docker pull` ,
`docker push` , and `docker search` will result in an error message prompting
the user to either secure or pass the `--insecure-registry` flag to the Docker
daemon as described above.
Local registries, whose IP address falls in the 127.0.0.0/8 range, are
automatically marked as insecure as of Docker 1.3.2. It is not recommended to
rely on this, as it may change in the future.
2015-09-04 10:28:35 -04:00
Enabling `--insecure-registry` , i.e., allowing un-encrypted and/or untrusted
2015-10-06 18:45:32 -04:00
communication, can be useful when running a local registry. However,
2015-09-04 10:28:35 -04:00
because its use creates security vulnerabilities it should ONLY be enabled for
2015-10-06 18:45:32 -04:00
testing purposes. For increased security, users should add their CA to their
2015-09-04 10:28:35 -04:00
system's list of trusted CAs instead of enabling `--insecure-registry` .
2017-10-04 12:09:12 -04:00
#### Legacy Registries
2015-09-25 16:49:50 -04:00
2020-03-15 10:11:43 -04:00
Starting with Docker 17.12, operations against registries supporting only the
2017-12-12 20:09:38 -05:00
legacy v1 protocol are no longer supported. 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.
2017-06-11 08:47:23 -04:00
2017-12-12 20:09:38 -05:00
The `disable-legacy-registry` configuration option has been removed and, when
used, will produce an error on daemon startup.
2017-06-11 08:47:23 -04:00
2015-09-25 16:49:50 -04:00
2017-10-04 12:09:12 -04:00
### Running a Docker daemon behind an HTTPS_PROXY
2015-06-21 16:41:38 -04:00
2016-05-07 21:36:10 -04:00
When running inside a LAN that uses an `HTTPS` proxy, the Docker Hub
2015-06-21 16:41:38 -04:00
certificates will be replaced by the proxy's certificates. These certificates
need to be added to your Docker host's configuration:
1. Install the `ca-certificates` package for your distribution
2. Ask your network admin for the proxy's CA certificate and append them to
`/etc/pki/tls/certs/ca-bundle.crt`
2016-04-28 02:55:22 -04:00
3. Then start your Docker daemon with `HTTPS_PROXY=http://username:password@proxy:port/ dockerd` .
2015-06-21 16:41:38 -04:00
The `username:` and `password@` are optional - and are only needed if your
proxy is set up to require authentication.
This will only add the proxy and authentication to the Docker daemon's requests -
your `docker build` s and running containers will need extra configuration to
use the proxy
2017-10-04 12:09:12 -04:00
### Default `ulimit` settings
2015-06-21 16:41:38 -04:00
`--default-ulimit` allows you to set the default `ulimit` options to use for
all containers. It takes the same options as `--ulimit` for `docker run` . If
these defaults are not set, `ulimit` settings will be inherited, if not set on
2015-10-06 18:45:32 -04:00
`docker run` , from the Docker daemon. Any `--ulimit` options passed to
2015-06-21 16:41:38 -04:00
`docker run` will overwrite these defaults.
2015-06-28 10:40:53 -04:00
Be careful setting `nproc` with the `ulimit` flag as `nproc` is designed by Linux to
set the maximum number of processes available to a user, not to a container. For details
please check the [run ](run.md ) reference.
2017-10-04 12:09:12 -04:00
### Node discovery
2015-09-10 19:12:00 -04:00
2016-02-01 02:49:25 -05:00
The `--cluster-advertise` option specifies the `host:port` or `interface:port`
2015-09-30 16:11:36 -04:00
combination that this particular daemon instance should use when advertising
itself to the cluster. The daemon is reached by remote hosts through this value.
If you specify an interface, make sure it includes the IP address of the actual
Docker host. For Engine installation created through `docker-machine` , the
interface is typically `eth1` .
2015-09-10 19:12:00 -04:00
2015-09-28 19:22:57 -04:00
The daemon uses [libkv ](https://github.com/docker/libkv/ ) to advertise
2015-09-30 16:11:36 -04:00
the node within the cluster. Some key-value backends support mutual
TLS. To configure the client TLS settings used by the daemon can be configured
2015-09-28 19:22:57 -04:00
using the `--cluster-store-opt` flag, specifying the paths to PEM encoded
files. For example:
```bash
2016-09-16 11:22:58 -04:00
$ sudo dockerd \
2015-09-28 19:22:57 -04:00
--cluster-advertise 192.168.1.2:2376 \
--cluster-store etcd://192.168.1.2:2379 \
--cluster-store-opt kv.cacertfile=/path/to/ca.pem \
--cluster-store-opt kv.certfile=/path/to/cert.pem \
--cluster-store-opt kv.keyfile=/path/to/key.pem
```
2015-10-09 12:04:34 -04:00
The currently supported cluster store options are:
2017-06-22 18:09:14 -04:00
| Option | Description |
|:----------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `discovery.heartbeat` | Specifies the heartbeat timer in seconds which is used by the daemon as a `keepalive` mechanism to make sure discovery module treats the node as alive in the cluster. If not configured, the default value is 20 seconds. |
2017-02-07 18:42:48 -05:00
| `discovery.ttl` | Specifies the TTL (time-to-live) in seconds which is used by the discovery module to timeout a node if a valid heartbeat is not received within the configured ttl value. If not configured, the default value is 60 seconds. |
2017-06-22 18:09:14 -04:00
| `kv.cacertfile` | Specifies the path to a local file with PEM encoded CA certificates to trust. |
| `kv.certfile` | Specifies the path to a local file with a PEM encoded certificate. This certificate is used as the client cert for communication with the Key/Value store. |
| `kv.keyfile` | Specifies the path to a local file with a PEM encoded private key. This private key is used as the client key for communication with the Key/Value store. |
| `kv.path` | Specifies the path in the Key/Value store. If not configured, the default value is 'docker/nodes'. |
2015-10-09 12:04:34 -04:00
2017-10-04 12:09:12 -04:00
### Access authorization
2015-11-04 08:49:53 -05:00
2015-12-08 07:54:33 -05:00
Docker's access authorization can be extended by authorization plugins that your
organization can purchase or build themselves. You can install one or more
authorization plugins when you start the Docker `daemon` using the
2016-01-12 19:38:18 -05:00
`--authorization-plugin=PLUGIN_ID` option.
2015-11-04 08:49:53 -05:00
2015-12-08 07:54:33 -05:00
```bash
2016-09-16 11:22:58 -04:00
$ sudo dockerd --authorization-plugin=plugin1 --authorization-plugin=plugin2,...
2015-12-08 07:54:33 -05:00
```
The `PLUGIN_ID` value is either the plugin's name or a path to its specification
file. The plugin's implementation determines whether you can specify a name or
path. Consult with your Docker administrator to get information about the
plugins available to you.
2017-05-01 09:27:42 -04:00
Once a plugin is installed, requests made to the `daemon` through the
command line or Docker's Engine API are allowed or denied by the plugin.
If you have multiple plugins installed, each plugin, in order, must
allow the request for it to complete.
2015-12-08 07:54:33 -05:00
For information about how to create an authorization plugin, see [authorization
2016-03-08 16:34:35 -05:00
plugin](../../extend/plugins_authorization.md) section in the Docker extend section of this documentation.
2015-11-04 08:49:53 -05:00
2015-10-09 12:04:34 -04:00
2017-10-04 12:09:12 -04:00
### Daemon user namespace options
2016-01-08 10:07:46 -05:00
2017-06-22 18:09:14 -04:00
The Linux kernel
[user namespace support ](http://man7.org/linux/man-pages/man7/user_namespaces.7.html )
provides additional security by enabling a process, and therefore a container,
to have a unique range of user and group IDs which are outside the traditional
user and group range utilized by the host system. Potentially the most important
security improvement is that, by default, container processes running as the
`root` user will have expected administrative privilege (with some restrictions)
inside the container but will effectively be mapped to an unprivileged `uid` on
the host.
For details about how to use this feature, as well as limitations, see
[Isolate containers with a user namespace ](https://docs.docker.com/engine/security/userns-remap/ ).
2016-01-08 10:07:46 -05:00
2017-02-07 18:42:48 -05:00
### Miscellaneous options
2015-06-21 16:41:38 -04:00
IP masquerading uses address translation to allow containers without a public
IP to talk to other machines on the Internet. This may interfere with some
2015-07-17 16:05:45 -04:00
network topologies and can be disabled with `--ip-masq=false` .
2015-06-21 16:41:38 -04:00
Docker supports softlinks for the Docker data directory (`/var/lib/docker`) and
for `/var/lib/docker/tmp` . The `DOCKER_TMPDIR` and the data directory can be
set like this:
2016-04-28 02:55:22 -04:00
DOCKER_TMPDIR=/mnt/disk2/tmp /usr/local/bin/dockerd -D -g /var/lib/docker -H unix:// > /var/lib/docker-machine/docker.log 2>& 1
2015-06-21 16:41:38 -04:00
# or
export DOCKER_TMPDIR=/mnt/disk2/tmp
2016-04-28 02:55:22 -04:00
/usr/local/bin/dockerd -D -g /var/lib/docker -H unix:// > /var/lib/docker-machine/docker.log 2>& 1
2015-12-08 07:54:33 -05:00
2017-02-07 18:42:48 -05:00
#### Default cgroup parent
2015-12-08 07:54:33 -05:00
2015-12-07 12:55:33 -05:00
The `--cgroup-parent` option allows you to set the default cgroup parent
2016-01-06 16:59:01 -05:00
to use for containers. If this option is not set, it defaults to `/docker` for
fs cgroup driver and `system.slice` for systemd cgroup driver.
2015-12-07 12:55:33 -05:00
If the cgroup has a leading forward slash (`/`), the cgroup is created
under the root cgroup, otherwise the cgroup is created under the daemon
cgroup.
Assuming the daemon is running in cgroup `daemoncgroup` ,
`--cgroup-parent=/foobar` creates a cgroup in
2016-02-11 18:21:52 -05:00
`/sys/fs/cgroup/memory/foobar` , whereas using `--cgroup-parent=foobar`
2015-12-07 12:55:33 -05:00
creates the cgroup in `/sys/fs/cgroup/memory/daemoncgroup/foobar`
2016-03-01 05:24:27 -05:00
The systemd cgroup driver has different rules for `--cgroup-parent` . Systemd
represents hierarchy by slice and the name of the slice encodes the location in
the tree. So `--cgroup-parent` for systemd cgroups should be a slice name. A
name can consist of a dash-separated series of names, which describes the path
to the slice from the root slice. For example, `--cgroup-parent=user-a-b.slice`
means the memory cgroup for the container is created in
`/sys/fs/cgroup/memory/user.slice/user-a.slice/user-a-b.slice/docker-<id>.scope` .
2015-12-07 12:55:33 -05:00
This setting can also be set per container, using the `--cgroup-parent`
option on `docker create` and `docker run` , and takes precedence over
the `--cgroup-parent` option on the daemon.
2015-12-10 18:35:10 -05:00
2017-02-07 18:42:48 -05:00
#### Daemon metrics
2016-10-28 13:28:39 -04:00
The `--metrics-addr` option takes a tcp address to serve the metrics API.
2016-11-15 14:45:20 -05:00
This feature is still experimental, therefore, the daemon must be running in experimental
2016-10-28 13:28:39 -04:00
mode for this feature to work.
2018-12-21 03:04:21 -05:00
To serve the metrics API on `localhost:9323` you would specify `--metrics-addr 127.0.0.1:9323` ,
allowing you to make requests on the API at `127.0.0.1:9323/metrics` to receive metrics in the
2016-10-28 13:28:39 -04:00
[prometheus ](https://prometheus.io/docs/instrumenting/exposition_formats/ ) format.
2018-12-21 03:04:21 -05:00
Port `9323` is the [default port associated with Docker
metrics](https://github.com/prometheus/prometheus/wiki/Default-port-allocations)
to avoid collisions with other prometheus exporters and services.
2016-10-28 13:28:39 -04:00
If you are running a prometheus server you can add this address to your scrape configs
to have prometheus collect metrics on Docker. For more information
2020-05-11 11:32:52 -04:00
on prometheus refer to the [prometheus website ](https://prometheus.io/ ).
2016-10-28 13:28:39 -04:00
2020-05-11 11:32:52 -04:00
```yaml
2016-10-28 13:28:39 -04:00
scrape_configs:
- job_name: 'docker'
static_configs:
2018-12-21 03:04:21 -05:00
- targets: ['127.0.0.1:9323']
2016-10-28 13:28:39 -04:00
```
Please note that this feature is still marked as experimental as metrics and metric
2016-11-15 14:45:20 -05:00
names could change while this feature is still in experimental. Please provide
2016-10-28 13:28:39 -04:00
feedback on what you would like to see collected in the API.
2017-11-08 12:13:11 -05:00
#### Node Generic Resources
The `--node-generic-resources` option takes a list of key-value
pair (`key=value`) that allows you to advertise user defined resources
in a swarm cluster.
The current expected use case is to advertise NVIDIA GPUs so that services
requesting `NVIDIA-GPU=[0-16]` can land on a node that has enough GPUs for
the task to run.
Example of usage:
```json
{
2020-05-11 11:32:52 -04:00
"node-generic-resources": ["NVIDIA-GPU=UUID1", "NVIDIA-GPU=UUID2"]
2017-11-08 12:13:11 -05:00
}
```
2017-10-04 12:09:12 -04:00
### Daemon configuration file
2015-12-10 18:35:10 -05:00
The `--config-file` option allows you to set any configuration option
for the daemon in a JSON format. This file uses the same flag names as keys,
except for flags that allow several entries, where it uses the plural
2016-06-17 00:41:58 -04:00
of the flag name, e.g., `labels` for the `label` flag.
2015-12-10 18:35:10 -05:00
The options set in the configuration file must not conflict with options set
via flags. The docker daemon fails to start if an option is duplicated between
the file and the flags, regardless their value. We do this to avoid
silently ignore changes introduced in configuration reloads.
For example, the daemon fails to start if you set daemon labels
2016-07-19 00:40:07 -04:00
in the configuration file and also set daemon labels via the `--label` flag.
2015-12-10 18:35:10 -05:00
Options that are not present in the file are ignored when the daemon starts.
2016-06-17 00:41:58 -04:00
2017-02-07 18:42:48 -05:00
##### On Linux
2016-06-17 00:41:58 -04:00
2016-07-19 00:40:07 -04:00
The default location of the configuration file on Linux is
2016-06-17 00:41:58 -04:00
`/etc/docker/daemon.json` . The `--config-file` flag can be used to specify a
2016-07-19 00:40:07 -04:00
non-default location.
2016-06-17 00:41:58 -04:00
This is a full example of the allowed configuration options on Linux:
2015-12-10 18:35:10 -05:00
```json
{
2020-05-11 11:32:52 -04:00
"authorization-plugins": [],
"data-root": "",
"dns": [],
"dns-opts": [],
"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-file":"5",
"labels": "somelabel",
"env": "os,customer"
},
"mtu": 0,
"pidfile": "",
"cluster-store": "",
"cluster-store-opts": {},
"cluster-advertise": "",
"max-concurrent-downloads": 3,
"max-concurrent-uploads": 5,
"default-shm-size": "64M",
"shutdown-timeout": 15,
"debug": true,
"hosts": [],
"log-level": "",
"tls": true,
"tlsverify": true,
"tlscacert": "",
"tlscert": "",
"tlskey": "",
"swarm-default-advertise-addr": "",
"api-cors-header": "",
"selinux-enabled": false,
"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": [],
"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}
]
2015-12-10 18:35:10 -05:00
}
```
2020-05-11 11:32:52 -04:00
> **Note:**
>
> You cannot set options in `daemon.json` that have already been set on
2017-02-23 07:49:00 -05:00
> daemon startup as a flag.
> On systems that use `systemd` to start the Docker daemon, `-H` is already set, so
> you cannot use the `hosts` key in `daemon.json` to add listening addresses.
> See https://docs.docker.com/engine/admin/systemd/#custom-docker-daemon-options for how
> to accomplish this task with a systemd drop-in file.
2017-02-07 18:42:48 -05:00
##### On Windows
2016-06-17 00:41:58 -04:00
The default location of the configuration file on Windows is
`%programdata%\docker\config\daemon.json` . The `--config-file` flag can be
2016-07-19 00:40:07 -04:00
used to specify a non-default location.
2016-06-17 00:41:58 -04:00
This is a full example of the allowed configuration options on Windows:
```json
{
2020-05-11 11:32:52 -04:00
"authorization-plugins": [],
"data-root": "",
"dns": [],
"dns-opts": [],
"dns-search": [],
"exec-opts": [],
"experimental": false,
"features":{},
"storage-driver": "",
"storage-opts": [],
"labels": [],
"log-driver": "",
"mtu": 0,
"pidfile": "",
"cluster-store": "",
"cluster-advertise": "",
"max-concurrent-downloads": 3,
"max-concurrent-uploads": 5,
"shutdown-timeout": 15,
"debug": true,
"hosts": [],
"log-level": "",
"tlsverify": true,
"tlscacert": "",
"tlscert": "",
"tlskey": "",
"swarm-default-advertise-addr": "",
"group": "",
"default-ulimits": {},
"bridge": "",
"fixed-cidr": "",
"raw-logs": false,
"allow-nondistributable-artifacts": [],
"registry-mirrors": [],
"insecure-registries": []
2016-06-17 00:41:58 -04:00
}
```
2018-08-27 18:52:50 -04:00
#### Feature options
2020-03-15 10:11:43 -04:00
The optional field `features` in `daemon.json` allows users to enable or disable specific
daemon features. For example, `{"features":{"buildkit": true}}` enables `buildkit` as the
2018-08-27 18:52:50 -04:00
default docker image builder.
The list of currently supported feature options:
- `buildkit` : It enables `buildkit` as default builder when set to `true` or disables it by
`false` . Note that if this option is not explicitly set in the daemon config file, then it
is up to the cli to determine which builder to invoke.
2017-02-07 18:42:48 -05:00
#### Configuration reload behavior
2015-12-10 18:35:10 -05:00
Some options can be reconfigured when the daemon is running without requiring
to restart the process. We use the `SIGHUP` signal in Linux to reload, and a global event
in Windows with the key `Global\docker-daemon-config-$PID` . The options can
be modified in the configuration file but still will check for conflicts with
the provided flags. The daemon fails to reconfigure itself
if there are conflicts, but it won't stop execution.
The list of currently supported options that can be reconfigured is this:
- `debug` : it changes the daemon to debug mode when set to true.
2016-02-17 20:08:11 -05:00
- `cluster-store` : it reloads the discovery store with the new address.
- `cluster-store-opts` : it uses the new options to reload the discovery store.
- `cluster-advertise` : it modifies the address advertised after reloading.
2016-01-26 15:44:51 -05:00
- `labels` : it replaces the daemon labels with a new set of labels.
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
Signed-off-by: nkwangleiGIT <nkwanglei@126.com>
2018-05-16 08:16:08 -04:00
- `live-restore` : Enables [keeping containers alive during daemon downtime ](https://docs.docker.com/config/containers/live-restore/ ).
2016-05-06 00:45:55 -04:00
- `max-concurrent-downloads` : it updates the max concurrent downloads for each pull.
- `max-concurrent-uploads` : it updates the max concurrent uploads for each push.
2016-05-23 17:49:50 -04:00
- `default-runtime` : it updates the runtime to be used if not is
specified at container creation. It defaults to "default" which is
the runtime shipped with the official docker packages.
- `runtimes` : it updates the list of available OCI runtimes that can
2018-06-25 14:54:33 -04:00
be used to run containers.
2018-08-23 16:46:29 -04:00
- `authorization-plugin` : it specifies the authorization plugins to use.
2017-05-09 17:00:31 -04:00
- `allow-nondistributable-artifacts` : Replaces the set of registries to which the daemon will push nondistributable artifacts with a new set of registries.
2016-04-24 22:51:28 -04:00
- `insecure-registries` : it replaces the daemon insecure registries with a new set of insecure registries. If some existing insecure registries in daemon's configuration are not in newly reloaded insecure resgitries, these existing ones will be removed from daemon's config.
2016-12-21 05:31:05 -05:00
- `registry-mirrors` : it replaces the daemon registry mirrors with a new set of registry mirrors. If some existing registry mirrors in daemon's configuration are not in newly reloaded registry mirrors, these existing ones will be removed from daemon's config.
2018-06-25 14:54:33 -04:00
- `shutdown-timeout` : it replaces the daemon's existing configuration timeout with a new timeout for shutting down all containers.
2018-08-23 16:46:29 -04:00
- `features` : it explicitly enables or disables specific features.
2016-02-17 20:08:11 -05:00
Updating and reloading the cluster configurations such as `--cluster-store` ,
`--cluster-advertise` and `--cluster-store-opts` will take effect only if
2016-02-24 03:13:44 -05:00
these configurations were not previously configured. If `--cluster-store`
has been provided in flags and `cluster-advertise` not, `cluster-advertise`
2016-04-24 22:51:28 -04:00
can be added in the configuration file without accompanied by `--cluster-store` .
2016-02-24 03:13:44 -05:00
Configuration reload will log a warning message if it detects a change in
previously configured cluster configurations.
2016-05-16 06:41:07 -04:00
2017-02-07 18:42:48 -05:00
### Run multiple daemons
2016-05-16 06:41:07 -04:00
> **Note:** Running multiple daemons on a single host is considered as "experimental". The user should be aware of
> unsolved problems. This solution may not work properly in some cases. Solutions are currently under development
> and will be delivered in the near future.
This section describes how to run multiple Docker daemons on a single host. To
run multiple daemons, you must configure each daemon so that it does not
conflict with other daemons on the same host. You can set these options either
by providing them as flags, or by using a [daemon configuration file ](#daemon-configuration-file ).
The following daemon options must be configured for each daemon:
2020-05-11 11:32:52 -04:00
```console
2016-05-16 06:41:07 -04:00
-b, --bridge= Attach containers to a network bridge
--exec-root=/var/run/docker Root of the Docker execdriver
2016-11-22 01:17:24 -05:00
--data-root=/var/lib/docker Root of persisted Docker data
2016-05-16 06:41:07 -04:00
-p, --pidfile=/var/run/docker.pid Path to use for daemon PID file
-H, --host=[] Daemon socket(s) to connect to
2016-07-07 17:22:12 -04:00
--iptables=true Enable addition of iptables rules
2016-05-16 06:41:07 -04:00
--config-file=/etc/docker/daemon.json Daemon configuration file
--tlscacert="~/.docker/ca.pem" Trust certs signed only by this CA
--tlscert="~/.docker/cert.pem" Path to TLS certificate file
--tlskey="~/.docker/key.pem" Path to TLS key file
```
When your daemons use different values for these flags, you can run them on the same host without any problems.
It is very important to properly understand the meaning of those options and to use them correctly.
- The `-b, --bridge=` flag is set to `docker0` as default bridge network. It is created automatically when you install Docker.
If you are not using the default, you must create and configure the bridge manually or just set it to 'none': `--bridge=none`
- `--exec-root` is the path where the container state is stored. The default value is `/var/run/docker` . Specify the path for
your running daemon here.
2016-11-22 01:17:24 -05:00
- `--data-root` is the path where persisted data such as images, volumes, and
cluster state are stored. The default value is `/var/lib/docker` . To avoid any
conflict with other daemons, set this parameter separately for each daemon.
2016-05-16 06:41:07 -04:00
- `-p, --pidfile=/var/run/docker.pid` is the path where the process ID of the daemon is stored. Specify the path for your
pid file here.
- `--host=[]` specifies where the Docker daemon will listen for client connections. If unspecified, it defaults to `/var/run/docker.sock` .
2016-11-18 17:22:49 -05:00
- `--iptables=false` prevents the Docker daemon from adding iptables rules. If
multiple daemons manage iptables rules, they may overwrite rules set by another
daemon. Be aware that disabling this option requires you to manually add
iptables rules to expose container ports. If you prevent Docker from adding
iptables rules, Docker will also not add IP masquerading rules, even if you set
`--ip-masq` to `true` . Without IP masquerading rules, Docker containers will not be
able to connect to external hosts or the internet when using network other than
default bridge.
2016-05-16 06:41:07 -04:00
- `--config-file=/etc/docker/daemon.json` is the path where configuration file is stored. You can use it instead of
daemon flags. Specify the path for each daemon.
- `--tls*` Docker daemon supports `--tlsverify` mode that enforces encrypted and authenticated remote connections.
The `--tls*` options enable use of specific certificates for individual daemons.
Example script for a separate “bootstrap” instance of the Docker daemon without network:
```bash
2016-09-16 11:22:58 -04:00
$ sudo dockerd \
2016-05-16 06:41:07 -04:00
-H unix:///var/run/docker-bootstrap.sock \
-p /var/run/docker-bootstrap.pid \
--iptables=false \
--ip-masq=false \
--bridge=none \
2016-11-22 01:17:24 -05:00
--data-root=/var/lib/docker-bootstrap \
2016-05-16 06:41:07 -04:00
--exec-root=/var/run/docker-bootstrap
```