问题描述:
Docker启动报错:Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
输入docker ps 命令 无法显示服务列表
Couldn’t connect to Docker daemon at http+docker://localunixsocket - is it running?
- 解决方式:正确的是将当前用户加入docker组
- 解决步骤
-
1 sudo groupadd docker #添加docker用户组 2 sudo gpasswd -a $USER docker #将登陆用户加入到docker用户组中 3 newgrp docker #更新用户组 4 docker ps #测试docker命令是否可以使用sudo正常使用 5 6 sudo service docker start 7 sudo systemctl enable docker #开机启动
Cannot connect to the Docker daemon at unix:///var/run/docker.sock
- 设置
daemon.json
,没有的话创建,位置/etc/docker\daemon.json
,设置为国内源 -
1 # 中科大镜像 2 { 3 "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"] 4 }
- 重新加载
-
1 cd /var/lib 2 rm docker 3 4 dockerd --config-file /etc/docker/daemon.json 5 6 systemctl daemon-reload
ps:参考docker启动报错:Cannot connect to the Docker daemon-CSDN博客
标签:daemon,Cannot,connect,var,docker,Docker From: https://www.cnblogs.com/freshfresh/p/17778605.html