Docker fails to build using OrthanC image ("More than one configuration path were provided on the command line")

Hey there, super noob Docker user here, and I was having some issues with making a Dockerfile and building a image. I am a student and was tasked by my teacher to configure and run a PACs server using OrthanC (which has a lot of images) using Docker, and I was then going to, later, use some Python scripts and other libraries for some analysis of some DICOM files. I am also meant to publish all of that into a GitHub rep

Anyway, I believed I had to create a simple Dockerfile and a .json configuration file to simply start a OrthanC server in localhost (I was then going to modify the Dockerfile and .json config file to allow for Python usage and sending some DICOM files). By running the simple command, which the OrthanC book provides (“docker run -p 4242:4242 -p 8042:8042 --rm jodogne/orthanc”), it runs pretty perfectly, and I can open localhost and it’s great.

However, the following Dockerfile and orthanc.json config file does not work (some phrases are written in Portuguese, which is my mother language, mostly to explain some procedures):

Dockerfile:

Utilização da imagem base oficial de OrthanC

FROM jodogne/orthanc-python

Copiando o arquivo de configuração .json, essencial para funcionamento do servidor PACs

COPY orthanc.json /config/orthanc.json

Expondo as portas necessárias (no padrão DICOM, as portas 8042 e 8043 são utilizadas)

EXPOSE 8042
EXPOSE 8043

Comando para iniciar o servidor PACs OrthanC

CMD [“orthanc”, “/config/orthanc.json”]

orthanc.json:
{
“Name”: “Orthanc-Custom”,
“DicomServer”: {
“Port”: 8042
},
“HttpServer”: {
“Port”: 8043,
“AllowOrigin”: “*”,
“RemoteAccessAllowed”: true
},
“Storage”: {
“Directory”: “/var/lib/orthanc/db”
},
“DicomScp”: {
“Enabled”: true,
“Port”: 104
}
}

I have a simple directory that has the Dockerfile and the .json in it and although it builds normally, when I try to run with docker run -p 8042:8042 -p 8043:8043 --rm orthanc-custom, it just gives the error: E0902 15:04:24.424245 MAIN main.cpp:1825] More than one configuration path were provided on the command line, aborting

Anyway, any help or tips would be greatly appreciated (University doesn’t wanna help as much lol), so thanks already!

The jodogne/orthanc image has an ENTRYPOINT set to the orthanc command

So you upplying the CMD [“orthanc”, “/config/orthanc.json”] line made the container run the following command on startup:

orthanc orthanc /config/orthanc.json

Those are what the command percieves as two configuration paths.

If you remove the --rm from your command, then run docker inspect <containername>, you’d see the entrypoint and the command the container has ran

Though, looking at your dockerfile, you may want to simply use the provided image, while mounting the config file, instead of building a new image. It seems this dockerfile does nothing useful - A Docker Compose file with a bind mount for the config would fit better in my opinion. Unless you’re required to build an image by your course

Thank you for the response!

Do I have to just remove the CMD line in the Dockerfile? Or should I just place a ENTRYPOINT command instead? (I saw that being recommended elsewhere online)

Also, yes, I imagine a .YAML for a compose would have been better, but the course has instead asked specifically for a Dockerfile inside the repo. I imagine they would test if I made a succesful one by cloning the repo and tried it themselves in their own terminal? ( They also asked for instructions on the README inside the repo, for example)

If you need to create an image with the configuration, then I’d simply remove the first variable in the CMD line

CMD [“/config/orthanc.json”]

The container runs the entry point as the main function and the CMD as arguments

Thank you! The localhost now does load, however no matter what login and password I try to enter, it simply does not work. I’m also a tiny bit suspectful that something is up with remote access, since the terminal says “remote access is not allowed” even though “RemoteAccessAllowed”: true is written inside the config .json. Also, inside the config, it’s written that the HTTP server is at port 8043, though after running the image it’s at 8042. Perhaps the configuration is simply not being “loaded” properly?