Skip to content

Latest commit

 

History

History
132 lines (110 loc) · 7.37 KB

README.md

File metadata and controls

132 lines (110 loc) · 7.37 KB

Orthanc for Docker

Docker Hub repository to build Orthanc and its official plugins. Orthanc is a lightweight, RESTful Vendor Neutral Archive for medical imaging.

Full documentation is available in the Orthanc Book.

Overview

Fork of the OrthancDocker project by Sébastien Jodogne.

Enables small multi-arch images by compiling Orthanc using multi-stage builds.

Features:

  • Updated base image to Debian Bullseye
  • Cross architecture support with the ability to build all architectures on a single platform.
  • Support for older Orthanc versions by patching build to use the new Orthanc repository.
  • Smaller images by separating build and final images with multi-stage builds vs Orthanc XArch.

Cross platform build using Docker BuildKit Emulation

Set up a cross platform build environment with this guide (Internet Archive). The following is a compact explanation. You may need to enable experimental features for Docker. First setup the binfmt container which allows emulation of other architectures:

$ sudo docker run --privileged --rm tonistiigi/binfmt --install all

Then setup the BuildKit builder:

$ docker buildx create --name my-new-builder --driver docker-container --use
$ docker buildx inspect --bootstrap

All architectures can then be built on a single machine using the following command which builds the latest commit and pushes the image with --push:

$ docker buildx build --platform linux/amd64,linux/arm/v7,linux/arm64 --push --tag scratchcat1/orthanc:latest ./

If you want to run the image locally with --load only specify one architecture as Docker doesn't currently support manifest lists locally.

$ docker buildx build --platform linux/amd64,linux/arm/v7,linux/arm64 --push --tag scratchcat1/orthanc:latest ./
$ docker run -it scratchcat1/orthanc:latest

Build times

Build times for AMD64, ARM64 and ARMv7.

R7 4800H
orthanc 2100s
orthanc-plugins 8000s

Native Build

Native builds are much faster but require the image to be built on a machine of architecture and the manifest must be manually created.

For each machine build for the native architecture build and push:

$ docker buildx build --platform <YOUR PLATFORM> --push --tag scratchcat1/orthanc:latest-<ARCH NAME> ./

Clients can automatically pick the correct architecture image using manifests. Create and push the manifest:

$ docker manifest create scratchcat1/orthanc:latest scratchcat1/orthanc:latest-<ARCH 1> scratchcat1/orthanc:latest-<ARCH 2> [OTHER ARCH IMAGES]
$ docker manifest push scratchcat1/orthanc:latest

Build times

R7 4800H i5 450M RPi 4 4G RPi 3
orthanc 270s 1602s 4000s OOM
orthanc-plugins 635.5s 7106.2s 11084s OOM

Building particular versions/branches

Without any arguments the default branch will be built for all components.
To build from a particular branch add the relevant build args:

$ docker buildx build --platform linux/amd64 \
 --build-arg orthanc_branch=Orthanc-1.9.0 \
 --build-arg databases_branch=OrthancPostgreSQL-3.3 \
 --tag scratchcat1/orthanc-plugins:1.9.0 ./

Changing arguments will disable the image caching for later components, therefore ARGS are defined as late as possible. Available arguments:

Build Argument List of branches
orthanc_branch List of branches
postgresql_branch List of branches
mysql_branch List of branches
dicomweb_branch List of branches
gdcm_branch List of branches
webviewer_branch List of branches
wsi_branch List of branches

Compatible plugin versions

The following table of plugin versions was constructed from the packages from Ubuntu releases.

Ubuntu Tag Orthanc Postgres MySQL DicomWeb GDCM WebViewer WSI
18.04 N/A Orthanc-1.3.1 OrthancPostgreSQL-2.2 OrthancMySQL-2.0 OrthancDicomWeb-0.4 default OrthancWebViewer-2.3 OrthancWSI-0.4
20.04 N/A Orthanc-1.5.8 OrthancPostgreSQL-3.2 OrthancMySQL-2.0 OrthancDicomWeb-1.0 default OrthancWebViewer-2.5 OrthancWSI-0.6
20.10 1.7.3 Orthanc-1.7.3 OrthancPostgreSQL-3.2 OrthancMySQL-3.0 OrthancDicomWeb-1.2 default OrthancWebViewer-2.6 OrthancWSI-0.7
21.04 1.9.1 Orthanc-1.9.0 OrthancPostgreSQL-3.3 OrthancMySQL-3.0 OrthancDicomWeb-1.5 OrthancGdcm-1.2 OrthancWebViewer-2.7 OrthancWSI-1.0

The following table of plugin versions is a set of builds I have tested but may not have the same level of stability

Date Tag Orthanc Postgres MySQL DicomWeb GDCM WebViewer WSI
2022/02/23 1.10.0 Orthanc-1.10.0 OrthancPostgreSQL-4.0 OrthancMySQL-4.3 OrthancDicomWeb-1.7 OrthancGdcm-1.4 OrthancWebViewer-2.8 OrthancWSI-1.1

Common problems

Out of Memory errors during build

Docker's buildx by default builds all independent images in parallel. This can cause OOM failures on systems less than 8GB RAM such as the Raspberry Pi 4 and an issue requesting a method to limit this already exists.

Additionally even on capable systems you have high ratio number of cores to available memory (e.g. 16 threads and 16GB) you may also run into OOM due to the large number of threads started. By default the build will use one thread per core found in /proc/cpuinfo per architecture being built. If you run into memory issues, you can manually set the thread count by setting COUNT_CORES in each build file. For example, to use 4 threads per build:

COUNT_CORES=4

Incorrectly set DNS

Example error output:

E0410 18:31:51.926529 OrthancException.cpp:57] Error in the network protocol: DicomAssociation - connecting to AET "<SOME_AET>": Failed to establish association (0006:0317 Peer aborted Association (or never connected); 0006:0320 Attempt to connect to unknown host: <HOSTNAME>)

A modality may make a query from an IP address in the list of modalities, but try retrieve to a hostname. The docker container may not use the hosts DNS servers by default, causing the hostname query to fail.
Fix: Set the DNS in your compose file or run with a manually specified DNS server with:

$ docker run --dns=<SOME_DNS> <IMAGE_NAME>

Licence

The content of this Docker repository is licensed under the AGPLv3+ license.