docker Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/

Posted 一点点积累

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了docker Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/相关的知识,希望对你有一定的参考价值。

利用docker构建时,报错

+ docker pull maven:3-alpine
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/images/create?fromImage=maven&tag=3-alpine: dial unix /var/run/docker.sock: connect: permission denied
script returned exit code 1
 

解决方案

启动docker或者重启docker之后
cd /var/run
sudo chmod 666 docker.sock

以上是关于docker Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/的主要内容,如果未能解决你的问题,请参考以下文章

解决Docker Got permission denied问题

安装完docker后报错Got permission denied while trying to connect to the Docker daemon socket...

亲测有效运行docker ps 出现Got permission denied问题的解决方案

Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.

Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.

docker使用遇到问题Got permission denied while trying to connect to the Docker daemon socket