系统:ubuntu16.04
我是按照docker的文档上安装的 https://docs.docker.com/linux/step_one/
安装完成后docker的ps pull search run命令都会报这个错 Cannot connect to the Docker daemon. Is the docker daemon running on this host?
在文档上看到让我检查 DOCKER_HOST
这环境变量,然而我并不知道在哪检查
阿神2017-04-24 16:01:19
I also had a similar error.
Because, I forgot to start the docker service.
service docker start
巴扎黑2017-04-24 16:01:19
You need to add user into docker group. by 'sudo gpasswd -a xxxx docker' (xxx is your user name)
Then restart your computer.
This problem should be solved.
PHP中文网2017-04-24 16:01:19
docker-machine restart&&eval "$(docker-machine env default)"&&docker-machine env just run this sequence
世界只因有你2017-04-24 16:01:19
Look at the default configuration of docker startup/etc/default/docker
没问题呗,然后重启服务service docker restart
.
sudo docker -H unix:///var/run/docker.sock -d &
Use -H to change the docker process to listen to the specified IP and port. By default, docker will listen to unix:///var/run/docker.sock and only allow local root users to connect. You can refer to "Docker Tutorial-Learn Basic Commands"
Reinstall docker.
阿神2017-04-24 16:01:19
su root # First switch to the root user, and then execute the following command
systemctl enable docker # Automatically start docker at boot
systemctl start docker # Start docker
systemctl restart docker # Restart docker