Docker Permission Denied

Hi all,

I am trying to used mindboggle for the first time. I followed the instructions to install the docker container on a Linux machine.

I set the environment variables as this:
HOST=/home/neuroimaging/Documents/ (path where I have the folder example_mri_data)
DOCK=/home/jovyan/work
MAGE=$DOCK/example_mri_data/T1.nii.gz
ID=arno

And ran the command:
sudo docker run --rm -ti -v $HOST:$DOCK nipy/mindboggle $IMAGE --id $ID

However I got this message:
/neurodocker/startup.sh: line 5: /home/jovyan/work/example_mri_data/T1.nii.gz: Permission denied

Why is this happening? Can anyone help me with this?

Thanks in advance!
Ana

That’s odd. What permissions do you have for accessing that image?

I have read and write permissions.

Given that you get the full path to your image (/home/…/T1.nii.gz) your issue shouldn’t be due to the typo above (MAGE=…). I usually run mindboggle in docker without using sudo. Perhaps your read/write permissions are different when using sudo to run mindboggle within a container which in turn must access /home/neuroimaging/…, which doesn’t sound like a user directory to me. Could you try putting the example_mri_data folder in your home directory, changing $HOST accordingly, and giving it another try? Thanks!

I was using sudo because it was the only way to run docker, but now I changed the permissions in the configuration file of docker and I can run without using sudo.
Still, I got the same error. I tried moving example_mri_data folder to different directories but I got always the same result. /home/neuroimaging/… is actually my home directory (my username is neuroimaging).
I also tested on macOS using the HOST=/Users/anacoelho/ but again the same error occurred.

Thanks for you help!

I’m dumbfounded, as I have never run into this problem on linux or macos. Rather than run that docker command, please try “docker run --rm -ti -v $HOST:$DOCK nipy/mindboggle” and to enter the docker container and see if you can access the example_mri_data folder from within the container.

When I do that I can enter the docker and access the example_mri_data folder. I can even run the separate commands for freesurfer, ants and mindboggle.

Hello all,
Was the problem solved? I am having exactly the same problem! I get the same “permission denied” error when trying to run the single command (as described here: https://mindboggle.readthedocs.io/en/latest/), although I can access the image from within the container and I could run some single commands (although FreeSurfer exited with errors).
By the way, I can also run docker only with sudo so far, can it be problematic?
I also cannot launch jupyter notebooks with the Mindboggle tutorial within docker, I will post it as a separate question.
Thanks and best wishes
Ria

I’m afraid I don’t understand the permission issue, because I have not run into this before.

However, regarding your Jupyter notebook issue, you should be able to resolve this with:

jupyter notebook /opt/mindboggle/docs/mindboggle_tutorial.ipynb --ip=0.0.0.0 --allow-root

according to @NPann’s reccommendation in https://github.com/nipy/mindboggle/issues/168; you will be able to use the jupyter command you used (and in the documentation) once I push a fix to the neurodocker.sh file, as recommended by @PeerHerholz in the same mindboggle github issue #168.

I am now experiencing the same permission issue (I was testing separate commands, which work fine).

I have submitted issue #178 to the GitHub repo (https://github.com/nipy/mindboggle/issues/178) and updated the website with warnings. I recommend running separate commands rather than the single command until we get to the bottom of this: https://mindboggle.readthedocs.io/en/latest/#run-separate-commands

Issue #178 has been resolved (https://github.com/nipy/mindboggle/issues/178).

I feel so silly – I simply forgot to add “mindboggle123” in the single command:

docker run --rm -ti -v $HOST:$DOCK nipy/mindboggle mindboggle123 $IMAGE --id $ID