Docker Community Forums

Share and learn in the Docker community.

Docker on Centos 7 Errno 13 Permission denied, tried :z, selinux, please help!

Hi everybody,

Thanks for your help with this. I’m running a docker instance on centos 7 to run a program called galaxy from The command to run docker is:

sudo docker run -d -p 8080:80 -p 8021:21 -p 8022:22 --mount type=bind,source="/mnt/finkbeinerlab/robodata",target="/finkbeiner/imaging/smb-robodata/" galaxy-docker

I see the galaxy gui in the localhost:8080, which is what I expect. Note the docker run command binds the local drive to our mounted NAS. When we run python code, it gets blocked on making a directory in

  File "/tool_deps/_conda/lib/python3.7/", line 221, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/finkbeiner/imaging/smb-robodata/Josh/tmp_galaxy_testing/GXYTMP-03312021-SW-NSCLC-cas-Output/BackgroundCorrected'

Because this is centos 7, I thought it would be an selinux issue, so I tried sudo setenforce 0 and checked sestatus showed permissive, but I still got the permission error. I tried using the legacy mounting style of -v /mnt/finkbeinerlab/robodata:/finkbeiner/imaging/smb-robodata:z and I added the :z flag to address selinux in a different way, but still the permission error persists.

What’s even more puzzling:
When I run the docker instance with bash, I can create directories in the same location. I’m wondering if at some point the sudo privileges get forgotten, and docker loses root access when I run it.

Thank you for your help!