I'm trying to run an nginx container as a service and share 2 volumes between the host machine and container, so that files in one directory are automatically shared with the other paired directory.
My docker-compose.yml is the following:
docker exec -it --privileged=true -u 6004:6004 dockernginx_nginx_1 bash
Debian GNU/Linux 8 (jessie)
CentOS Linux 7 (Core)
Docker was running with
--selinux-enabled=true, this prohibited me from accessing the contents of directories in the container.
Read more: http://www.projectatomic.io/blog/2016/07/docker-selinux-flag/
The solution was to disable it, it can either be done by (1) configuring or by (2) installing the non-selinux CentOS package, I went with option 2:
I made sure to reinstall and update Docker from 1.10 to 1.12.1 and not install
docker-engine-selinux.noarch but instead have
docker-engine.x86_64 and have the SELinux package installed as a dependency (yum does this automatically). By doing this and starting the Docker daemon, you can verify with
ps aux | grep "docker" that
docker-containerd is not started with the