我正在使用最新版本的 Fedora 22,并已完成所有更新。
我正在尝试使用 docker,但权限被拒绝。以 root 身份运行时,我没有看到以下问题。我真的需要 root 访问权限才能使用 docker 吗?
$ ps -ef | grep docker
root 931 1 0 10:35 ? 00:00:00 /usr/bin/docker -d --selinux-enabled
codingf+ 2953 2809 0 10:37 pts/0 00:00:00 grep --color=auto docker
我正在运行 docker daemon
$ docker version
Client version: 1.7.1.fc22
Client API version: 1.19
Package Version (client): docker-1.7.1-8.gitb6416b7.fc22.x86_64
Go version (client): go1.4.2
Git commit (client): b6416b7/1.7.1
OS/Arch (client): linux/amd64
Get http:///var/run/docker.sock/v1.19/version: dial unix /var/run/docker.sock: permission denied. Are you trying to connect to a TLS-enabled daemon without TLS?
$ docker info
Get http:///var/run/docker.sock/v1.19/info: dial unix /var/run/docker.sock: permission denied. Are you trying to connect to a TLS-enabled daemon without TLS?
$ docker run hello-world
Post http:///var/run/docker.sock/v1.19/containers/create: dial unix /var/run/docker.sock: permission denied. Are you trying to connect to a TLS-enabled daemon without TLS?
答案1
尝试须藤docker run。Docker 服务以 root 身份运行,并且 unix 域套接字需要 root 权限才能进行通信。