Permission denied on accessing host directory inside containers
What’s going on?
Creating a container by Podman or Docker with -v
option, the access to your data volume was denied.
$ mkdir -p /tmp/directory
$ podman run -itd --name test -v /tmp/directory/:/directory:rw fedora:28 /bin/bash
$ podman exec test ls /directory
ls: cannot open directory '/directory': Permission denied
Error: exit status 2
Solutions
Because of the restriction of SELinux, you can be blocked to access the host directories from a cont