套接字 – docker:在尝试连接到unix的Docker守护程序套接字时获得权限被拒绝:

前端之家收集整理的这篇文章主要介绍了套接字 – docker:在尝试连接到unix的Docker守护程序套接字时获得权限被拒绝:前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我试过这个

docker run --rm -it -p 2181:2181 -p 8081:8081 -p 8082:8082 -p 8083:8083 -p 9092:9092 -e ADV_HOST=127.0.0.1 landoop/fast-data-dev

我收到了错误

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

我检查过守护进程是否正在运行

● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: active (running) since уто 2018-01-23 10:52:50 CET; 2h 14min ago
     Docs: https://docs.docker.com
 Main PID: 11082 (dockerd)

这是我的/ etc / default / docker

# Customize location of Docker binary (especially for development testing).
#DOCKERD="/usr/local/bin/dockerd"

# Use DOCKER_OPTS to modify the daemon startup options.
#DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"

# If you need Docker to use an HTTP proxy,it can also be specified here.
#export http_proxy="http://127.0.0.1:3128/"

# This is also a handy place to tweak where Docker's temporary files go.
#export DOCKER_TMPDIR="/mnt/bigdrive/docker-tmp"

如何编辑docker_opts来解决我的问题?

试试这个usermod -aG docker ${USER},将你的用户添加到docker组.

在此之后,您必须重新启动docker守护程序sudo service docker restart

原文链接:https://www.f2er.com/docker/436953.html

猜你在找的Docker相关文章