Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?(代码
Posted 闲言_
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?(代码相关的知识,希望对你有一定的参考价值。
错误产生环境
centos 重启之后docker 无法运行
今天打开某个项目发现一直报错,一直显示连接不上fastdfs 。我才想起来,我的centos重启过,docker 没设置开机自启。使用docker有关的命令都会报错。
错误描述
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
错误原因
docker 没设置开机自启
解决办法docker
- 进入 /etc/docker,没有daemon.json文件就自己新建一个:
cd /etc/docker
编辑daemon.json文件:
加入这段代码:
{
"registry-mirrors": ["https://registry.docker-cn.com"]
}
- 然后重启docker:
systemctl restart docker.service
再使用docker命令时,就没有问题了
截图如下:
原文地址:传送门
以上是关于Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?(代码的主要内容,如果未能解决你的问题,请参考以下文章
Cannot connect to database because the database client
Cannot connect to the Docker daemon. Is the docker daemon running on this host
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Cannot connect to the Docker datemon at tcp://0.0.0.0:2375 is the docker daemon runing?
Error when connecting to the GNS3 server: Cannot connect to http://127.0.0.1:3080. Please check if G
Docker初次安装运行出错:Cannot connect to the Docker daemon at ***/docker.sock. Is the docker daemon running?