Fmriprep with Docker Rootless


This may not be the right forum for this question, but I’m having trouble using Docker rootless to run fmriprep. While I have been able to run fmriprep in regular Docker mode, I’m having trouble using it with rootless.

Has fmriprep been run successfully with Docker rootless mode? Are there any specific options in the fmriprep command that need to be set for this?



Have you tried using fmriprep-docker with the -u flag to pass your UID? You may also need to set a -w to ensure that the scratch directory is placed somewhere your user has permissions.

Assuming you’ve tried these, can you share your full command?

I did try running it with the -u flag, and I get the same error:

OSError: [Errno 30] Read-only file system: ‘/data/tvanasse’

My full command is as follows:

mem=10 #gb
  docker run -it --rm \
  -u $( id -u ) \
  -v $bids_root_dir:/data:ro \
  -v $bids_root_dir/derivatives/fmriprep/sub-${subj}:/out \
  -v $bids_root_dir/code/license.txt:/fslicense.txt:ro \
  nipreps/fmriprep:20.2.1 /data /out \
  participant \
  --participant_label sub-${subj} \
  --fs-license-file /fslicense.txt \
  --nprocs $nthreads \
  --mem $mem \
  --skip-bids-validation \
  -w $bids_root_dir/derivatives/fmriprep/sub-${subj}



This is within the container. You’ll instead need to add a -v flag before nipreps/fmriprep:20.2.1 and a -w to a location that it’s mounted to.

It looks like you’re planning on making your working directory your output directory, which seems likely to cause problems. I would suggest keeping them separate.

Maybe I misinterpreted your advice, but if I run the -v flag before “nipreps/fmriprep:20.2.1”, I get the following error:

docker: invalid reference format.
See 'docker run --help'.
./ line 41: nipreps/fmriprep:20.2.1: No such file or directory

-v /scratch/on/host:/scratch/in/container