Closed seifer44 closed 6 years ago
Unfortunately I'm not that familiar with selinux. Did you try to mount with :Z?
https://stackoverflow.com/questions/24288616/permission-denied-on-accessing-host-directory-in-docker
Never mind. I had the wrong context set on the file. You want to use svirt_sandbox_file_t
semanage fcontext -a -t svirt_sandbox_file_t '/var/lib/docker/persistent-volumes(/.*)?'
I'd highly recommend getting familiar with using SELinux. It's a frustrating juggle to permission stuff out sometimes, but it's great for adding a strong layer of security to your stuff.
EDIT: It looks like that's in your Stack Overflow thread.
Sounded like :Z adds the rules automatically.
I'm having trouble with trying to get this container to run with SELinux enabled on my CentOS 7 machine.
I'm attempting to have my save files under /var/lib/docker/persistent-volumes/factorio.
I create a custom SELinux module with those attributes above from audit2allow. These were captured when SELinux was in Permissive mode, and a new container was started with a fresh persistent volume.
When SELinix is re-enabled, the container fails to start. Here is a fresh container, with the persistent directory empty:
However, the files are actually present.
I'm not sure what the issue is with accessing the files after it creates them. I'm currently running an up-to-date host with
Docker version 1.12.6, build ec8512b/1.12.6
.