Docker Community Forums

Share and learn in the Docker community.

Cannot access to mounted volume

Hello,
I fail to access to my mounted volume /prometheus/

docker run -d --volume ‘/opt/monitor-server/conf:/prometheus’ prom/alertmanager:v0.16.2

docker exec -it 630cfbf66fc1 /bin/sh

I have a error message:

/ ls alertmanager bin dev etc home lib proc prometheus root sys tmp usr var / cd prometheus/
/bin/sh: cd: can’t cd to prometheus/: Permission denied

Does somebody could help me ?

Regards.
Frédéric

what is the rights of this folder: /opt/monitor-server/conf ? what about the files in it?

Thanks to the people here, the solution is quite simple (but not obvious):

My GNU/Linux container host has SELinux activated, and that’s why I was having permissions problems. The solution is to simply append a :z to the podman run volume argument so that this:

podman run -it -v /host/foobar:/src_dir /bin/bash

becomes this:

podman run -it -v /host/foobar:/src_dir:z /bin/bash

That’s it.