Search code examples
dockerdocker-machinedocker-containernvidia-dockerdocker-command

Unable to start the server using docker command - Mount directory -OCI Runtime error


I would like to start the orthanc server based on the below docker command. However when I execute the command, I get the error as shown below.

Please note that both the orthanc.json and orthanc-db are present in the respective folders

/orthanc/orthanc.json - orthanc.json is present under orthanc folder

/orthanc/orthanc-db - orthanc-db is present under orthanc folder

/etc/orthanc/orthanc.json - orthanc.json is present under /etc/orthanc folder

/var/lib/orthanc/orthanc-db - orthanc-db is present under /var/lib/orthanc folder

All the paths listed above are valid. I am able to navigate to them

Docker command to start orthanc server

docker run -p 4242:4242 -p 8042:8042 --rm --name orthanc -v 
/orthanc/orthanc.json:/etc/orthanc/orthanc.json -v /orthanc/orthanc- 
db:/var/lib/orthanc/orthanc-db jodogne/orthanc-plugins /etc/orthanc -- 
verbose

Error message after executing the command

Error response from daemon: OCI runtime create failed: 
container_linux.go:345: starting container process caused "process_lin                           
ux.go:424: container init caused \"rootfs_linux.go:58: mounting 
\\\"/orthanc/orthanc.json\\\" to rootfs \\\"/var/lib/docker/overlay2/                           
48131fde47610cf1bac93d0316e2c1d6dfbfdb90a0e6cc24344cc6a1308eaccd/merged\
\\"at \\\"/var/lib/docker/overlay2/48131fde47610cf1bac93d031                           
6e2c1d6dfbfdb90a0e6cc24344cc6a1308eaccd/merged/etc/orthanc/orthanc.json\
\\"caused \\\"not a directory\\\"\"": unknown: Are you tryin                         
 g to mount a directory onto a file (or vice-versa)? Check if the 
specified host path exists and is the expected type.

Can you please help me fix this issue? I am trying to start the orthanc server through this docker command. not sure why it's throwing an error when the files are present.


Solution

  • You are running the container from the same directory where your folders are (the ones you are mounting). This means that the path should be prefixed with the current working directory:

    docker run -p 4242:4242 -p 8042:8042 --rm --name orthanc -v $(pwd)/orthanc/orthanc.json:/etc/orthanc/orthanc.json -v $(pwd)/orthanc/orthanc- db:/var/lib/orthanc/orthanc-db jodogne/orthanc-plugins /etc/orthanc -- verbose