And if it is possible, how would you configure each daemon - graph location, images location, etc?
相关问题
- Docker task in Azure devops won't accept "$(pw
- Unable to run mariadb when mount volume
- Unspecified error (0x80004005) while running a Doc
- What would prevent code running in a Docker contai
- How to reload apache in php-apache docker containe
Yes, this is doable by using Docker Machine
Using this you can create multiple docker daemons and switch between them as you want.
Great question! It is possible to start a Docker daemon inside a container. In that container you would be able to start more containers. This way you can run docker daemons with different settings on the same host machine.
Checkout this project: https://github.com/jpetazzo/dind. It provides a Docker image that contains Docker itself, just as you require.
Yes, it's perfectly possible to run two Docker daemons on a single host even without Docker Machine. As of Docker 18.09.0-ce, the following
dockerd
flags are the ones that could cause conflicts if two daemons used the defaults:The default for
--bridge
isdocker0
, and if you're not using the default, you must create and configure the bridge manually (Docker won't create/manage it for you). More details below.--exec-root
is where container state is stored (default:/var/run/docker
).--data-root
is where images are stored (default:/var/lib/docker
).--host
specifies where the Docker daemon will listen for client connections. If unspecified, it defaults to/var/run/docker.sock
.--pidfile
is where the process ID of the daemon is stored (default:/var/run/docker.pid
).So, as long as your two daemons use different values for these flags, you can run them on the same host. Example script (including network setup):
Example usage:
Updated for changes from Docker 1.9.1 to 18.09.0-ce, in case anyone is using a very old version: