无法通过unix:///var/run/docker.sock连接到Docker守护程序?

时间:2018-11-05 15:06:26

标签: linux docker service

$ sudo服务docker start

* Starting Docker: docker

$ sudo服务泊坞窗状态

* Docker is not running

$ sudo docker pull bkimminich / juice-shop

  Using default tag: latest
   Warning: failed to get default registry endpoint from daemon (Cannot connect 
   to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon 
   running?). Using system default: https://index.docker.io/v1/
   Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the 
   docker daemon running?

1 个答案:

答案 0 :(得分:0)

感谢:https://www.santoshsrinivas.com/docker-on-ubuntu-16-04/

  • 添加组docker如果存在则跳过)。
  • 然后,将user添加到组docker
  • 最后,重新启动服务。

此外,添加组后,您需要再次注销并登录(用户)。

bash
sudo groupadd docker
sudo gpasswd -a ${USER} docker
sudo service docker restart`