Docker image Making the Orthanc database persistent

Hi,

I have trouble with localizing the Orthanc database in Synology docker installation.
The container manager of Synology reports the filesystem of the image is in /var/lib/orthanc/db , but it really isn’t. There is no such folder.

What I want is to have the DB with the DICOMs securely written on the NAS and want to know where is it.

The Orthanc documentation states that:

The filesystem of Docker containers is volatile (its content is deleted once the container stops). You can make the Orthanc database persistent by mapping the /var/lib/orthanc/db folder of the container to some path in the filesystem of your Linux host, e.g.:

$ mkdir /tmp/orthanc-db
$ docker run -p 4242:4242 -p 8042:8042 --rm -v /tmp/orthanc-db/:/var/lib/orthanc/db/ jodogne/orthanc:1.12.1

I find that the DB is NOT volatile - when a DICOM is uploaded in orthanc and I stop and restart the container, it stays in. The DICOM is not lost.
If I follow the above instructions and map the supposed db to a folder like:

docker run -p 4242:4242 -p 8042:8042 --rm -v /tmp/orthanc-db/:/var/lib/orthanc/db/ jodogne/orthanc:latest

I get an index in /tmp/orthanc-db which doesn’t change in size if additional DICOM’s are uploaded and the DICOMs do not dissapear if the /tmp/orthanc-db folder is deleted.

Hi,

I can ensure you that the Orthanc documentation is correct wrt Docker and volume persistence in general - thousands of Orthanc instances use it every day.

I therefore encourage you to read the Synology documentation wrt “synology docker volume mapping” that should, hopefully, give you more info.

You might also want to check that you do not have 2 Orthanc running on your system and the data is received on the right Orthanc.

Best regards,

Alain

Hi Alain, yes, I dug deeper in docker and found that I have to search inside the docker image the directories in question. Also found out how to map them to a folder on the host and it works.
What is incorrect in the documentation is that the docker image DB is volatile - it is recorded indeed in a layer and stopping the image does not delete it.
Mapping it to the host’s file system through docker’s volume command is better however, I suppose, as at it gives control over recorded DICOMs and the docker image doesn’t grow with the DB inside.

That is really the only reasonable option. If you do not do so, your data will disappear when you recreate the container or change the image (which will recreate the container).

1 Like