colonperez
(Colonperez)
February 29, 2024, 9:57pm
1
Hello, I am trying to run a image from an online source and the command looks like this
docker run -it --rm --user root --platform linux/amd64 \
-v $PWD/data:/input_BIDS:ro \
-v $PWD/preprocess_outputs/:/preprocess_outputs/:rw,Z \
-v $PWD/confound_correction_outputs:/confound_correction_outputs/ \
ghcr.io/cobralab/rabies:latest -p MultiProc --local_threads 4 --scale_min_memory 0.7 confound_correction preprocess_outputs/ confound_correction_outputs/ --conf_list WM_signal CSF_signal mot_6 --smoothing_filter 0.3
and I get the following error
FileNotFoundError: [Errno 2] No such file or directory: 'preprocess_outputs/rabies_preprocess.pkl'
I checked with
docker run -it --rm --user root --entrypoint /bin/bash --platform linux/amd64 \
-v $PWD/data:/input_BIDS:ro \
-v $PWD/preprocess_outputs/:/preprocess_outputs/ \
-v $PWD/confound_correction_outputs:/confound_correction_outputs/ \
ghcr.io/cobralab/rabies:latest
And the file and folder are where they are supposed to be in the container. The file is also present locally on the computer in the specified path.
Any insights?
meyay
(Metin Y.)
February 29, 2024, 10:04pm
2
colonperez:
$PWD/preprocess_outputs
So the file exists on your host at this path $PWD/preprocess_outputs/rabies_preprocess.pkl
and is not expected to come from the image?
1 Like
meyay
(Metin Y.)
February 29, 2024, 10:06pm
4
Then it should work as it is. Since you added :Z you must have a selinux based system, which should take care of selinux permissions as well. I don’t recall what the difference of :Z and :z is, but I do remember there is one.
meyay
(Metin Y.)
February 29, 2024, 10:07pm
5
My bad, I missed this is a relative and not and absolute path. Please share your Dockerfile, so we get an idea of what the WORKDIR is.
The problem seems to be in the command after the image name, where you have provided the output directories for the confound_correction
subcommand using relative paths. Change the docker run
command as follows:
docker run -it --rm --user root --platform linux/amd64 \
-v $PWD/data:/input_BIDS:ro \
-v $PWD/preprocess_outputs/:/preprocess_outputs/:rw,Z \
-v $PWD/confound_correction_outputs:/confound_correction_outputs/ \
ghcr.io/cobralab/rabies:latest -p MultiProc --local_threads 4 --scale_min_memory 0.7 confound_correction /preprocess_outputs/ /confound_correction_outputs/ --conf_list WM_signal CSF_signal mot_6 --smoothing_filter 0.3
Note the absolute paths after confound_correction
. It should work then.
meyay:
t the WORKDIR is.
Thank you so much! I feel so dumb but that was it. I appreciate the help