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

When building using the docker, an error

+ 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
 

solution

After starting or restarting docker docker
CD / var / RUN
the sudo the chmod 666 docker.sock

Guess you like

Origin www.cnblogs.com/codeBang/p/11904886.html