在安装Docker以后,执行命令出现错误。
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/containers/json": dial unix /var/run/docker.sock: connect: permission denied
解决办法
- 添加当前用户到docker组
sudo gpasswd -a $USER docker
- 更新dokcer组
newgrp docker
- 重启docker(可选,如何执行完以上命令仍无法解决问题)
sudo systemctl restart docker
标签:daemon,run,socket,unix,connect,denied,var,docker
From: https://www.cnblogs.com/wangyong5609/p/16976838.html