docker 权限问题 Got permission denied while trying to connect to the Docker daemon socket at

在用户权限下docker 命令需要 sudo 否则出现以下问题

Got 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/version": dial unix /var/run/docker.sock: connect: permission denied

.1

通过将用户添加到docker用户组可以将sudo去掉,命令如下

sudo groupadd docker #添加docker用户组

sudo gpasswd -a $USER docker #将登陆用户加入到docker用户组中

newgrp docker #更新用户组

2

sudo chmod a+rw /var/run/docker.sock

你可能感兴趣的:(docker 权限问题 Got permission denied while trying to connect to the Docker daemon socket at)