0

I just installed Docker on mu Ubuntu 14.10 64 bit OS and I followed the steps to create the necessary certificates and keys so that I can secure my docker http remote connections. When I tried to issue the following command,

sudo docker --tlsverify --tlscacert=ca.pem --tlscert=cert.pem --tlskey=key.pem -H=x.x.x.x:2376 version

I get to see the following error message:

Cannot connect to the Docker daemon. Is 'docker -d' running on this host

The -H=x.x.x.x is the host as I see when I did a ifconfig and found the host from the docker0 entry that was listed.

Please help me identify why I'm not able to do anything with my daemon.

joesan
  • 13,963
  • 27
  • 95
  • 232

2 Answers2

2

Did you change the options on the daemon itself? Paraphrasing the docs:

You can listen on port 2376 on all network interfaces with -H tcp://0.0.0.0:2376, or on a particular network interface using its IP address: -H tcp://192.168.59.103:2376.

To do this you could edit /etc/init/docker.conf and update the DOCKER_OPTS variable

Bryan
  • 11,398
  • 3
  • 53
  • 78
  • Thanks for the reply. I just realized that I did not start my docker daemon using the -H option. So I killed the old docker process pid by doing a rm -R on /var/run/docker.pid. Then I started docker using the -H option. I gave the address that points to the localhost as sudo docker -d -H 127.0.0.1:2376 – joesan Nov 23 '14 at 14:04
  • I guess now I can connect to the docker daemon from my client using the ip address of my machine. Let me try that! – joesan Nov 23 '14 at 14:05
-1

Sometime ago i had this issue :

"Cannot connect to the Docker daemon at tcp://127.0.0.1:2376. Is the docker daemon running?"

Looking an your question, you did not specify if you are working on Ubuntu WSL (Bash).

Regardless of your env configuration.

Looking for the file ".bashrc" in your

add the following to it

export DOCKER_HOST=tcp://192.168.59.103:2376

Happy Devops!

raphaeljuwe
  • 119
  • 2
  • 2