Docker was unable to connect to the docker daemons

Docker Can’t Connect to Docker Daemon
After I update my Docker version to 0.8.0, I get an error message while entering sudo Docker version : when I update my Docker version to 0.8.0, I received an error message when I entered sudo docker version :

Client version: 0.8.0
Go version (client): go1.2
Git commit (client): cc3a8c8
2014/02/19 12:54:16 Can't connect to docker daemon. Is 'docker -d' running on this host?

And I’ve followed the instructions And entered command sudo docker-d , And I got this: I went into the command sudo docker-d , And I got this:

[/var/lib/docker|2462000b] +job initserver()
[/var/lib/docker|2462000b.initserver()] Creating server
open /var/lib/docker/aufs/layers/cf2414da53f9bcfaa48bc3d58360d7f1cfd3784e4fe51fbef95197709dfc285d: no such file or directory[/var/lib/docker|2462000b] -job initserver() = ERR (1)
2014/02/19 12:55:57 initserver: open /var/lib/docker/aufs/layers/cf2414da53f9bcfaa48bc3d58360d7f1cfd3784e4fe51fbef95197709dfc285d: no such file or directory

How do I solve the problem? how do I solve this problem?


# 1/f,
Reference: https://stackoom.com/question/1Tlln/Docker cannot connect to the docker daemon


# 2 floor
Do a ps aux>4 grep docker Do a ps aux>5 grep docker ps aux>6 grep docker0 to see if the daemon is running.1 2 3 ps aux>7 grep Docker to see if the daemon is running. If not run /etc/init.d/docker start If not run /etc/init.d/docker start


The # 3 floor
I had the same problem – “Can’t connect to docker daemon.” I had the same problem – “Can’t connect to docker daemon.” (except I didn’t get any ‘file not found’ errors on trying to start the server.) (except I didn’t get any ‘file not found’ errors on trying to start the server.)
‘ps’ showed that “/usr/bin/ docker-d “was still running ‘ps’ showed “/usr/bin/ docker-d” was still running
I realised that I “d never later succeeded in running the server myself Mr. I realized that I never really succeeded in running the server. Every attempt had produced each attempt produced

...
2014/03/24 21:57:29 pid file found, ensure docker is not running or delete /var/run/docker.pid

So I belatedly realised that installing docker had maybe registered the daemon with upstart, which had started it for me. So I belatedly realized installation docker may have already registered with the upstart daemon, this has already started it for me. Hence, trying to kill the daemon to manually restart it fails (operation not permitted). so, try to terminate the daemon to manually restart it failed (operation is not allowed). So I did a So I did a So I made a

sudo kill -9 <PID>

on the daemon process. on the daemon. Another daemon immediately took its place, and this new one DOES now let my CLI client connect: Another daemon now lets my CLI client connect:

$ sudo docker info
Containers: 0
Images: 0
Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Dirs: 0
WARNING: No memory limit support
WARNING: No swap limit support

# 4 floor
I have similar problem. I have similar problem. I had to logout and login again to shell because I have just installed Docker and following command didn’t show in my environment. I had to logout and login the shell again because I had just installed Docker and the following commands were not shown in my environment.

export DOCKER_HOST=127.0.0.1:4243 >> ~/.bashrc

The # 5 floor
The best way to find out according to Docker isn ‘t working will be to run The daemon manually. find The Docker not work is The best way to manually run daemons.

$ sudo service docker stop
$ ps aux | grep docker  # do this until you don't see /usr/bin/docker -d
$ /usr/bin/docker -d

The Docker daemon logs to STDOUT, so it will start spitting out whatever it’s doing. Docker daemon logs to STDOUT, so it will start spitting out whatever it’s doing.
Here was what my problem was: this is my problem :

[8bf47e42.initserver()] Creating pidfile
2015/01/11 15:20:33 pid file found, ensure docker is not running or delete /var/run/docker.pid

This was because the instance had been cloned from another virtual machine. This is because the instance has been cloned from another virtual machine. I just had to remove the pidfile, and everything worked afterwards. I just need to delete the pidfile, and everything worked afterwards.
Of course, instead of blindly assuming this will work, I ‘d suggest running the daemon manually one more time and reviewing the log output for any other errors before starting the service back up. of course, I suggest that don’t blindly assume that this will be effective, I suggest to manually run again daemon, And check the log output for any other errors before starting the service backup.


# 6 building
, I got the same problem., , I got the same problem. In CentOS 6.5: In CentOS 6.5:

ps aux |grep `cat /var/run/docker.pid`

If it shows no Docker daemon exists, then I type: If it shows no Docker daemon exists, then I type:

docker -d

and Then press Ctrl + D0 to stop Docker. Because we use the -d option, Docker will run as daemon. Because we use the -d option, Docker will run as daemon. Now we can do: Now we can do:

service docker start

Then I can do a docker pull centos. Then I can do a docker pull centos. That’s all. .
NOTE: If these do not work, you can try yum update, and then repeat these again, because I yum install before these. NOTE: If these don’t work, you can try yum update and then repeat these as I did before yum install.

Read More: