As we saw in the earlier recipe when SELinux is configured, a non-privileged container cannot access files on the volume created after mounting the directory from the host system. However, sometimes it is needed to allow access to host files from the container. In this recipe, we'll see how to allow access in such cases.
Allowing writes to volumes mounted from the host with SELinux ON
Getting ready
You'll require a Fedora/RHEL/CentOS host with the latest version of Docker installed, which can be accessed through a Docker client. Also, the SELinux should be set to enforcing, and the Docker daemon configured to use SELinux.