系统: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?
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.
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"
I also had a similar error.
Because, I forgot to start the docker service.
service docker start
Please use
sudo
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.
docker-machine restart&&eval "$(docker-machine env default)"&&docker-machine env just run this sequence
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.
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