1

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.

The Great
  • 7,215
  • 7
  • 40
  • 128
  • 1
    I saw the message. On which OS are you running? And are you running docker directly or some kind of docker in docker setup? Also just to be sure, "/orthanc" is indeed in the root "/" and not in the current folder right? I am trying to run the same in the meantime. – Mihai May 24 '19 at 09:45
  • Whereas for etc and var folder, I directly use cd /var/.. and cd /etc/.... Orthanc (child) is one level down from home, it's under nvidiadeploy (parent) folder from home – The Great May 24 '19 at 09:55
  • Ahh regarding OS, my local desktop is windows and I connect to remote system which is in Ubuntu to run the docker command. – The Great May 24 '19 at 09:58
  • 1
    So the /orthanc folder is not at root level. I think your command should look like this: 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 Error message – Mihai May 24 '19 at 10:51
  • The /etc and /var are inside the container so they can't create a problem – Mihai May 24 '19 at 10:52
  • Hello @Mihai - Thanks for the response. If you can write it as an answer, I can mark it as a solution. can I know why does it prompt for password? Should I be executing the command in nvidiadeploy folder, even then it is asking for password. If I had sudo access, it wouldn't prompt for password. I remember running docker run commands without password prompts. Can you please help me understand why? – The Great May 24 '19 at 12:12
  • Is there any identifier in error message that can help me in knowing that it prompts for a password? – The Great May 24 '19 at 12:26
  • If you add your user to the docker group and open a new she'll then it will not ask for sudo or password. I will write the answer – Mihai May 24 '19 at 12:36
  • If you have more questions you can write me on Telegram (@MexHix). Good luck! – Mihai May 24 '19 at 12:41

1 Answers1

0

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
Mihai
  • 9,526
  • 2
  • 18
  • 40
  • Can you please help me with the below issue? Though it worked last time, I still get this error now "docker: Error response from daemon: create orthanc/orthanc/orthanc.json: "orthanc/orthanc/orthanc.json" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path. See 'docker run --help'. " – The Great Jun 06 '19 at 08:28
  • I don't know why does it show as "orthanc/orthanc/orthanc.json". – The Great Jun 06 '19 at 08:29
  • are you running on Windows? – Mihai Jun 06 '19 at 08:34
  • I am running this command like how I did last time. In same system. Linux machine (remote system) is where I can run docker commands. So through my local desktop(windows), I use Putty to connect to remote linux system where I run the above command – The Great Jun 06 '19 at 08:36
  • Okay, now I enclosed pwd is parenthesis, I get the below error "OCI runtime create failed: container_linux.go:345: starting container process caused "process_linux.go:424: container init caused \"rootfs_linux.go:58: mounting \\\"/home/selva/claradeploy/orthanc/orthanc.json\\\" to rootfs \\\"/var/lib/docker/overlay2/61f04907f2c0dd6782f97fa2dcbc8cc85548ffa2bced8e3a59b5a29cd69c0af4/merged\\\" at \\\"/var/lib/docker/overlay2/61f04907f2c0dd6782f97fa2dcbc8cc85548ffa2bced8e3a59b5a29cd69c0af4/merged/etc/orthanc/orthanc.json\\\" ." – The Great Jun 06 '19 at 08:38
  • Same as error mentioned in the question. I just chopped few characters – The Great Jun 06 '19 at 08:39
  • because you ran the wrong command it could be that the volumes got corrupted. Try to remove all containers (also exited ones) and all volumes. Then if you try again it should work. Make sure you run the command exactly as I posted it. – Mihai Jun 06 '19 at 08:42
  • There are some other projects dependant on certain volumes. I am afraid I can't touch them. But you suggest me all removing all containers related to this. Moreover, I don't see any volume created due to the above command. Do I have to still remove other/irrelevant volumes to the above command? – The Great Jun 06 '19 at 08:52
  • Is it possible to remove them using helm? When I use docker rm, it doesn't work. But that work I am doing/trying to kind of pla around used kubernetes and pods. So can you let me know how can I remove containers using helm? – The Great Jun 06 '19 at 09:08
  • as far as I know helm does not remove containers. try to change the path of the volume inside the container and see if it works (container won't work but only to see if it passes the point where you get the error). If it does then the volume is the problem. – Mihai Jun 06 '19 at 09:41
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/194528/discussion-between-selva-and-mihai). – The Great Jun 06 '19 at 09:41