Docker容器启动失败 Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? 的解决办法

, Read in about 1 min

Posted by Ryen on Monday, September 6, 2021
With final update in December 26,2023

本文总阅读量

今日运行Docker容器启动失败,报 Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

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

cd /etc/docker

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

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

然后重启docker:

systemctl restart docker.service

再使用docker命令时,就没有问题了
希望这个方法对你们有用

最后,得益于这位博主的文章来写的,感谢~
https://www.cnblogs.com/huhyoung/p/9495956.html

「真诚赞赏,手留余香」

Ryen's Blog

真诚赞赏,手留余香

使用微信扫描二维码完成支付