Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

  • Post author:
  • Post category:其他


注:本文章为转载,原文连接放在文章下面。

启动

docker

时,发现与docker有关的命令都会报错Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?


1. 例如查看版本信息


2

.

重启


容器


3. systemctl status docker 查看docker状态也发现错误:

最后解决问题方法是: 进入 /etc/docker,没有daemon.json文件就自己新建一个:

cd /etc/docker

复制

编辑daemon.json文件: 加入这段代码:

{ 
   
 "registry-mirrors": ["https://registry.docker-cn.com"]
}

复制

然后重启docker:

systemctl restart docker.service

复制

再使用docker命令时,就没有问题了 希望这个方法对你们有用 最后,我是得益于这位博主的文章来写的,感谢~

Docker容器启动失败 Failed to start Docker Application Container Engine的解决办法 – 赤道上的冰雕 – 博客园

各位朋友还是设置docker开机自启吧

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/139653.html原文链接:https://javaforall.cn

原文连接:

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? – 腾讯云开发者社区-腾讯云 (tencent.com)