weaveworks-experiments / flux-classic

Microservice routing
http://weaveworks.github.io/flux/
Apache License 2.0
82 stars 10 forks source link

/var/run/docker.sock: connect: permission denied #37

Closed asiqq23 closed 8 years ago

asiqq23 commented 8 years ago

Running command:

docker run --name=fluxd -d -e ETCD_ADDRESS \ --net=host --cap-add=NET_ADMIN \ -v /var/run/docker.sock:/var/run/docker.sock \ weaveworks/fluxd --host-ip $HOST_IP

starts container with fluxd, but don't permits fluxd to do connection routing.

I saw in logs that time="2016-04-06T21:54:44Z" level=error error="Get http://unix.sock/version: dial unix /var/run/docker.sock: connect: permission denied"

For me worked if i added --privileged=true flag to give special permissions. Maybe there is another solution?

dpw commented 8 years ago

Thanks for reporting this. What Linux distro are you running, and what version of docker?

asiqq23 commented 8 years ago

Docker version 1.9.1, build 78ee77d/1.9.1 CentOS Linux release 7.2.1511 (Core)

And I am root

dpw commented 8 years ago

CentOS Linux release 7.2.1511 (Core)

Ah yes. It's an selinux issue. So either you'll have to use the --privileged workaround, or use https://github.com/dpw/selinux-dockersock

We'll update the docs to mention this.