March 2017
Beginner to intermediate
925 pages
18h 11m
English
As we saw in the earlier recipe, when SELinux is configured, a nonprivileged 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.
A Fedora/RHEL/CentOS host with the latest version of Docker installed, which can be accessed through a Docker client. Also, SELinux is set to enforcing mode and the Docker daemon is configured to use SELinux.
z or Z option as follows:$ docker run -it -v /tmp/:/tmp/host:z docker.io/fedora bash $ docker run -it -v /tmp/:/tmp/host:Z ...
Read now
Unlock full access