No persistent saving to docker volumes - jodogne/orthanc-plugins:1.12.4

I started from a working docker compose file from a official sample. Volume data was persistent accross docker compose down and subsequent docker compose up --build -d runs:

version: "2"
services:
  orthanc-pacs:
    build: orthanc-pacs
    restart: unless-stopped
    ports: ["8042:8042"]
    volumes: ["orthanc-storage-pacs:/var/lib/orthanc/db:Z"]
  orthanc-middleman:
    build: orthanc-middleman
    restart: unless-stopped
    ports: ["8043:8042"]
    volumes: ["orthanc-storage-middleman:/var/lib/orthanc/db:Z"]
  orthanc-modality:
    build: orthanc-modality
    restart: unless-stopped
    ports: ["8044:8042"]
    volumes: ["orthanc-storage-modality:/var/lib/orthanc/db:Z"]
volumes:
  orthanc-storage-pacs:
  orthanc-storage-middleman:
  orthanc-storage-modality:

Now I replaced the docker image used in the orthanc containers (to save some memory):

instead of orthancteam/orthanc I switched to jodogne/orthanc-plugins:1.12.4

now the persistent saving of patient data is not working anymore.

Is there a plugin or configuration I can use to fix the persistent saving to docker volumes?

here my orthanc.json:


{
  "Name": "Orthanc-modality",
	"RemoteAccessAllowed" : true,
	"AuthenticationEnabled" : true,
	"RegisteredUsers" : {
		"demo": "demo"
	},
  "DicomAet": "MODALITY",
  "DicomModalities": {
      "pacs": ["PACS", "orthanc-pacs", 4242], // to perform query-retrieve on the PACS
      "middleman": ["MIDDLEMAN", "orthanc-middleman", 4242] // used as a C-Store destination
  }
},
  "Plugins" : [
    "/usr/share/orthanc/plugins", "/usr/local/share/orthanc/plugins"
  ]

Hello

This could be related to permissions. By default, the Orthanc Team images run as root, if I am not mistaken. If these folders that you’re mapping belong to root, the default images from Sébastien, running with user orthanc, could have issues using them. That is just an hypothesis.

To check this, I would exec a shell in your container, navigate to /var/lib/orthanc/db, and make sure that you can examine the containers of the bound folder from there : that adding a file at that location, from the container, can be seen on the host, and the opposite, and that the container is able to write.

Another quick test you can make is chmod -R 777 on all of them before starting the compose file.

Let us know how it goes!

HTH

Benjamin

I found the issue. jodogne/orthanc uses a different storage location:

/etc/orthanc/OrthancStorage

So the corrected docker-compose.yml should look like this:

services:
  orthanc-pacs:
    build: orthanc-pacs
    restart: unless-stopped
    ports: ["8042:8042"]
    volumes: ["orthanc-storage-pacs:/etc/orthanc/OrthancStorage:Z"]
  orthanc-middleman:
    build: orthanc-middleman
    restart: unless-stopped
    ports: ["8043:8042"]
    volumes: ["orthanc-storage-middleman:/etc/orthanc/OrthancStorage:Z"]
  orthanc-modality:
    build: orthanc-modality
    restart: unless-stopped
    ports: ["8044:8042"]
    volumes: ["orthanc-storage-modality:/etc/orthanc/OrthancStorage:Z"]
volumes:
  orthanc-storage-pacs:
  orthanc-storage-middleman:
  orthanc-storage-modality:

i.e. replacing /var/lib/orthanc/db used in the orthancteam/orthanc image.

Would be nice if such subtle differences were documented somewhere…

Just run docker run -p 8047:8042 jodogne/orthanc
and check the logs:

W0528 14:01:24.921845             MAIN OrthancInitialization.cpp:444] SQLite index directory: "/var/lib/orthanc/db"
W0528 14:01:24.922546             MAIN OrthancInitialization.cpp:543] Storage directory: "/var/lib/orthanc/db"

And you’ll realize that the default storage path is /var/lib/orthanc/db/.

Then, check your configuration file and you’ll realize that you are the one who is configuring OrthancStorage somewhere very likely in your build process since you are building a custom image.

Cheers,

Alain

1 Like

Hi @CoelnerOrthancUser

Your confusion might stem from the fact that the default configuration uses the folder names you’ve indicated:

  // Path to the directory that holds the heavyweight files (i.e. the
  // raw DICOM instances). Backslashes must be either escaped by
  // doubling them, or replaced by forward slashes "/".
  "StorageDirectory" : "OrthancStorage",

  // Path to the directory that holds the SQLite index (if unset, the
  // value of StorageDirectory is used). This index could be stored on
  // a RAM-drive or a SSD device for performance reasons.
  "IndexDirectory" : "OrthancStorage",

Orthanc will generate these folders in /etc/orthanc if relative paths are computed starting from the folder containing the configuration file…

But please note that the default configuration (the one generated by Orthanc when you pass the --config flag) is not strictly equivalent to the one used in the jodogne/orthanc container.