在我将 Docker 版本更新为 0.8.0
后,我在输入 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?
我已经按照说明输入了命令sudo docker -d
,我得到了这个:
[/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
我该如何解决这个问题?
Linux
Post-installation steps for Linux文档揭示了以下步骤:
- 创建 docker 组。
sudo groupadd docker
- Add the user to the docker group.
sudo usermod -aG docker $(whoami)
- Log out and log back in to ensure docker runs with correct permissions.
- Start docker.
sudo service docker start
Mac OS X
As Dayel Ostraco says is necessary to add environments variables:
docker-machine start # Start virtual machine for docker
docker-machine env # It's helps to get environment variables
eval "$(docker-machine env default)" # Set environment variables
docker-machine start
命令输出注释以指导流程。
我是一名优秀的程序员,十分优秀!