Search code examples
dockercontainersdocker-machinemounted-volumes

Unable to copy the file to docker host


I am trying to execute the below docker command where I am trying to get the 'Orthanc.json" file to my system folder which is "orthanc".

docker run --rm --entrypoint=cat jodogne/orthanc /etc/orthanc/orthanc.json >  
 orthanc/orthanc.json

under /etc/orthanc/orthanc.json - It is a directory and not a file - Am not able to use vim editor to read/open the file. - This is a public one. Anyone can access using this link Orthanc link

I get the below error message, Can you please help me understand what is the issue?

-bash: /orthanc/orthanc.json: Is a directory

orthanc.json should be a file but why does it treat it as a directory?

when I use vim orthanc.json, it throws an error message that it's a directory.

What should I be doing to see this as a config file as I have to make changes to it?


Solution

  • You've somehow already got a directory named /orthanc/orthanc.json on your host system. Remove it and try again.

    rmdir /orthanc/orthanc.json     # if empty
    rm -rf /orthanc/orthanc.json    # if not empty -- but see what's in there first!