Add documentation for running multiple daemons
(cherry picked from commit 9be8f04950f918b91e3d4166597e9e2eee74fbd6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| ... | ... |
@@ -956,3 +956,59 @@ has been provided in flags and `cluster-advertise` not, `cluster-advertise` |
| 956 | 956 |
can be added in the configuration file without accompanied by `--cluster-store` |
| 957 | 957 |
Configuration reload will log a warning message if it detects a change in |
| 958 | 958 |
previously configured cluster configurations. |
| 959 |
+ |
|
| 960 |
+ |
|
| 961 |
+## Running multiple daemons |
|
| 962 |
+ |
|
| 963 |
+> **Note:** Running multiple daemons on a single host is considered as "experimental". The user should be aware of |
|
| 964 |
+> unsolved problems. This solution may not work properly in some cases. Solutions are currently under development |
|
| 965 |
+> and will be delivered in the near future. |
|
| 966 |
+ |
|
| 967 |
+This section describes how to run multiple Docker daemons on a single host. To |
|
| 968 |
+run multiple daemons, you must configure each daemon so that it does not |
|
| 969 |
+conflict with other daemons on the same host. You can set these options either |
|
| 970 |
+by providing them as flags, or by using a [daemon configuration file](#daemon-configuration-file). |
|
| 971 |
+ |
|
| 972 |
+The following daemon options must be configured for each daemon: |
|
| 973 |
+ |
|
| 974 |
+```bash |
|
| 975 |
+-b, --bridge= Attach containers to a network bridge |
|
| 976 |
+--exec-root=/var/run/docker Root of the Docker execdriver |
|
| 977 |
+-g, --graph=/var/lib/docker Root of the Docker runtime |
|
| 978 |
+-p, --pidfile=/var/run/docker.pid Path to use for daemon PID file |
|
| 979 |
+-H, --host=[] Daemon socket(s) to connect to |
|
| 980 |
+--config-file=/etc/docker/daemon.json Daemon configuration file |
|
| 981 |
+--tlscacert="~/.docker/ca.pem" Trust certs signed only by this CA |
|
| 982 |
+--tlscert="~/.docker/cert.pem" Path to TLS certificate file |
|
| 983 |
+--tlskey="~/.docker/key.pem" Path to TLS key file |
|
| 984 |
+``` |
|
| 985 |
+ |
|
| 986 |
+When your daemons use different values for these flags, you can run them on the same host without any problems. |
|
| 987 |
+It is very important to properly understand the meaning of those options and to use them correctly. |
|
| 988 |
+ |
|
| 989 |
+- The `-b, --bridge=` flag is set to `docker0` as default bridge network. It is created automatically when you install Docker. |
|
| 990 |
+If you are not using the default, you must create and configure the bridge manually or just set it to 'none': `--bridge=none` |
|
| 991 |
+- `--exec-root` is the path where the container state is stored. The default value is `/var/run/docker`. Specify the path for |
|
| 992 |
+your running daemon here. |
|
| 993 |
+- `--graph` is the path where images are stored. The default value is `/var/lib/docker`. To avoid any conflict with other daemons |
|
| 994 |
+set this parameter separately for each daemon. |
|
| 995 |
+- `-p, --pidfile=/var/run/docker.pid` is the path where the process ID of the daemon is stored. Specify the path for your |
|
| 996 |
+pid file here. |
|
| 997 |
+- `--host=[]` specifies where the Docker daemon will listen for client connections. If unspecified, it defaults to `/var/run/docker.sock`. |
|
| 998 |
+- `--config-file=/etc/docker/daemon.json` is the path where configuration file is stored. You can use it instead of |
|
| 999 |
+daemon flags. Specify the path for each daemon. |
|
| 1000 |
+- `--tls*` Docker daemon supports `--tlsverify` mode that enforces encrypted and authenticated remote connections. |
|
| 1001 |
+The `--tls*` options enable use of specific certificates for individual daemons. |
|
| 1002 |
+ |
|
| 1003 |
+Example script for a separate “bootstrap” instance of the Docker daemon without network: |
|
| 1004 |
+ |
|
| 1005 |
+```bash |
|
| 1006 |
+$ docker daemon \ |
|
| 1007 |
+ -H unix:///var/run/docker-bootstrap.sock \ |
|
| 1008 |
+ -p /var/run/docker-bootstrap.pid \ |
|
| 1009 |
+ --iptables=false \ |
|
| 1010 |
+ --ip-masq=false \ |
|
| 1011 |
+ --bridge=none \ |
|
| 1012 |
+ --graph=/var/lib/docker-bootstrap \ |
|
| 1013 |
+ --exec-root=/var/run/docker-bootstrap |
|
| 1014 |
+``` |