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

网上找了好多办法,都不能解决,不清楚啥原因,,终于看见一位老铁的评论,,我问题解决了。
在这里插入图片描述
开始执行过程。。。
1.先修改daemon.json文件

 vi /etc/docker/daemon.json

进入之后,把里面内容修改成 空的花括号“ {} ”
然后保存退出,然后重启 docker

service docker restart

然后就去测试下问题解决没,我们来执行以下

docker run hello-world

docker-Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon runn_第1张图片
很好,问题解决了!!!感谢这里老铁!!!

最后科普:
该文件 /etc/docker/daemon.json 不应该存在或者如果存在则应该具​​有有效的JSON对象。空白文件会产生错误。删除文件或者如果您想要一个空白文件,请使用以下内容

{
}

这将创建一个空白的json对象

最后科普这一段来自:(需要才能打开)
https://stackoverflow.com/questions/45335316/unable-to-configure-the-docker-daemon-with-file-etc-docker-daemon-json-eof

你可能感兴趣的:(虚拟机)