Description of problem: I have started a docker containner, dependent of another containers with: docker-compose run TARGET SELinux is preventing python from 'connectto' accesses on the unix_stream_socket /run/docker.sock. ***** Plugin catchall (100. confidence) suggests ************************** If you believe that python should be allowed connectto access on the docker.sock unix_stream_socket by default. Then you should report this as a bug. You can generate a local policy module to allow this access. Do allow this access for now by executing: # grep python /var/log/audit/audit.log | audit2allow -M mypol # semodule -i mypol.pp Additional Information: Source Context system_u:system_r:svirt_lxc_net_t:s0:c356,c584 Target Context system_u:system_r:docker_t:s0 Target Objects /run/docker.sock [ unix_stream_socket ] Source python Source Path python Port <Unknown> Host (removed) Source RPM Packages Target RPM Packages Policy RPM selinux-policy-3.13.1-158.12.fc23.noarch Selinux Enabled True Policy Type targeted Enforcing Mode Enforcing Host Name (removed) Platform Linux (removed) 4.4.6-300.fc23.x86_64 #1 SMP Wed Mar 16 22:10:37 UTC 2016 x86_64 x86_64 Alert Count 8 First Seen 2016-04-08 13:08:07 BST Last Seen 2016-04-08 13:08:14 BST Local ID 1481c7b9-5c2e-46f3-b069-89ab7b5cbda4 Raw Audit Messages type=AVC msg=audit(1460120894.283:872): avc: denied { connectto } for pid=14794 comm="python" path="/run/docker.sock" scontext=system_u:system_r:svirt_lxc_net_t:s0:c356,c584 tcontext=system_u:system_r:docker_t:s0 tclass=unix_stream_socket permissive=0 Hash: python,svirt_lxc_net_t,docker_t,unix_stream_socket,connectto Version-Release number of selected component: selinux-policy-3.13.1-158.12.fc23.noarch Additional info: reporter: libreport-2.6.4 hashmarkername: setroubleshoot kernel: 4.4.6-300.fc23.x86_64 type: libreport
You have to do this in a privileged container or in a container with SELinux disabled. Allowing a container access to the docker socket, is basically allowing the container process full root access to your system. docker run --security-opt label:disable
I just blogged on this. http://danwalsh.livejournal.com/74095.html