After I update my Docker version to 0.8.0
, I get an error message while entering 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:
[/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?
To fix, you need to issue the following commands in the terminal. I'll explain each step:
Now, if you want to simplify things and get more time, you can run my
init
script with the parameterinstallDocker
:A reboot is optional, but I suggest you do it to be sure all runs smoothly.
Do a
ps aux | grep docker
to see if the daemon is running. If not run/etc/init.d/docker start
I got the same problem. In CentOS 6.5:
If it shows no Docker daemon process exists, then I type:
Then Ctrl + D to stop Docker. Because we use the
-d
option, Docker will run as daemon. Now we can do: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 Iyum install
before these.The best way to find out why Docker isn't working will be to run the daemon manually.
The Docker daemon logs to STDOUT, so it will start spitting out whatever it's doing.
Here was what my problem was:
This was because the instance had been cloned from another virtual machine. I just had to remove 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.
If you are running on OS X using Docker tool, follow this.
Restart the daemon and configure your environment:
And then
Finally,
To test the daemon is running:
docker ps -a
ordocker-machine ls
. This will list all containers.I had the same problem running Docker 1.10 on Ubuntu 14.04 and none of the given answers worked. For me, the fix was to specify the storage driver when running the Docker daemon.