Docker daemon not starting after adding the -H flag
I’m trying to use Docker Swarm, to do that I need to start the Docker daemon with the -H flag on each node using this command:
docker -H tcp://0.0.0.0:2375 -d
When doing this on my node (Debian 8, Docker 1.6.0) the command never stops, even if it displays that the daemon has completed initialization.
The complete output:
INFO +job init_networkdriver() INFO +job serveapi(tcp://0.0.0.0:2375) INFO Listening for HTTP on tcp (0.0.0.0:2375) INFO /!\ DON'T BIND ON ANY IP ADDRESS WITHOUT setting -tlsverify IF YOU DON'T KNOW WHAT YOU'RE DOING /!\ INFO -job init_networkdriver() = OK (0) WARN mountpoint for memory not found INFO Loading containers: start. INFO Loading containers: done. INFO docker daemon: 1.6.0 4749651; execdriver: native-0.2; graphdriver: aufs INFO +job acceptconnections() INFO -job acceptconnections() = OK (0) INFO Daemon has completed initialization
After this last line nothing happens and I’m not able to write another command.
I also ran the command using
screen to be able to run a command after the first one but I have a error message when running a Docker command:
FATA Cannot connect to the Docker daemon. Is 'docker -d' running on this host?
This command clearly states that the daemon didn’t start correctly. How could I have a Docker daemon that starts and ensures that remote API on Swarm Agents is available over TCP for the Swarm Manager?
One Solution collect form web for “Docker daemon not starting after adding the -H flag”
This commands states the client cannot talk to the docker daemon/engine/server. According to logs, your server is running.
With only the
-H tcp://0.0.0.0:2375, if you didn’t export
DOCKER_HOST=127.0.0.1:2375, the docker client won’t be able to talk to the daemon. You have 2 ways to handle this :
# Exporting DOCKER_HOST when you want to talk to it $ export DOCKER_HOST=127.0.0.1:2375 $ docker ps
Or update your server options to also bind to the socket, like this
# docker -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock -d $ docker ps