Problems running fmriprep using Docker on Windows machine

I have been going in circles the past week trying to get fmriprep to run. I am using the following code (using PowerShell):

docker run -ti --rm -v "D:/Box Sync/cclab_Paul_Scotti/ContIEM_Box/bids/Nifti:/data:ro"
-v “D:/Box Sync/cclab_Paul_Scotti/ContIEM_Box/bids/fmriprep:/out” -v "D:/Box Sync/cclab_Paul_Scotti/ContIEM_Box/license.txt:/opt/freesurfer/license.txt"
-v “D:/DockerWorkDir” -w "D:/DockerWorkDir"
poldracklab/fmriprep:latest /data /out/out
participant --participant_label 101

I immediately get the error

C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: the working directory ‘D:/DockerWorkDir’ is invalid, it needs to be an absolute path.
See ‘C:\Program Files\Docker\Docker\Resources\bin\docker.exe run --help’.

But I don’t understand this, since ‘D:/DockerWorkDir’ is an absolute path? I’ve been going in circles trying to solve this using Google, including making a junction between my C:/ProgramData and D:/ProgramData and changing my Hyper-V settings to be in my D: drive.

If I remove “D:” from the two instances of “D:/DockerWorkDir” in my code, then it will run through everything but eventually error. Nothing ever gets saved into the DockerWorkDir using this method so I feel like something I’m doing is very wrong.

Any help is appreciated, thanks!

Hi @PaulScotti, judging by later posts it seems you managed to solve your problems. Could you confirm what you did to troubleshoot these issues? Thanks!

haha I never figured it out. I redid everything on a Mac to get around it.

Okay, just in case other users see something similar, I think docker was complaining about the -v argument formatting - it wasn’t specifying the mount point within the container (e.g., something like -v "D:/DockerWorkDir:/work" would have worked).

Then your specification for the work directory is relative to the host, but it should be an absolute path in the container. Given the above suggestion for the -v argument, you would like to set this to -w /work.

1 Like

I really appreciate you taking the time to look up and answer this older question, thanks @oesteban. I may go back to my windows machine and retest it out.