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

问题描述:

ubuntu 18.04 docker拉取镜像时出错

docker: 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.24/containers/create: dial unix /var/run/docker.sock: connect: permission denied.

原因分析:

非root,所以权限不足

解决方案:

sudo gpasswd -a $(whoami) docker  #将当前用户添加至docker用户组
newgrp docker                 #更新docker用户组
上一篇:MySQL之九---分布式架构(Mycat/DBLE)


下一篇:记一次Linux内核中socket源码走读