安装 docker 执行错误如下:
$ docker ps
permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get “http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json”: dial unix /var/run/docker.sock: connect: permission denied
解决方法:
docker.sock 文件的权限问题,可以重置其权限:文章来源:https://www.toymoban.com/news/detail-643388.html
sudo chmod 666 /var/run/docker.sock
之后就正常了文章来源地址https://www.toymoban.com/news/detail-643388.html
lighthouse@VM-ubuntu:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
到了这里,关于permission denied while trying to connect to the Docker daemon socket 错误的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!