我今天在我的Ubuntu 16.04 PC上安装了Docker,它是戴尔XPS15。客户端运行良好,但如果我启动:
docker version
它返回一个permission denied
错误:
Client:
Version: 17.12.1-ce
API version: 1.35
Go version: go1.9.4
Git commit: 7390fc6
Built: Tue Feb 27 22:17:40 2018
OS/Arch: linux/amd64
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.35/version: dial unix
/var/run/docker.sock: connect: permission denied
我该如何解决?
文档has a chapter on running the client as a non-root user,只需按照说明操作,你应该很高兴,所以不需要每次都输入sudo
:)
$ sudo groupadd docker
$ sudo usermod -aG docker $USER
然后从您的用户会话注销并再次登录并尝试docker run hello-world
。
谢谢,使用sudo它工作正常,现在我尝试添加此权限