Docker image with DICOM toolchains https://github.com/opendicom/docker-dicomtools
This repository provides a lightweight, repeatable Docker image that bundles common DICOM command-line utilities in a single place. It is useful for automation tasks like inspecting or transforming DICOM files, scripting maintenance jobs, and running scheduled workflows in a container.
The image is designed to work well in “container-native” environments:
docker logs).CMD) for one-off tasks or long-running custom processes.See the examples/ folder for ready-to-run scripts, a sample crontab, and docker compose files.
Includes (see Dockerfile for exact versions):
This image runs scheduled jobs using supercronic (a cron runner designed for containers).
stdout/stderr) is printed to the container logs./crontab_file.The default container command is equivalent to:
supercronic -passthrough-logs /crontab_file
To use it, mount a crontab file to /crontab_file and your scripts to /opt/scripts.
docker build -t opendicom/dicomtools:local .
chmod +x examples/scripts/hello.sh
docker run --rm --name dicomtools-cron \
-e TEST_VAR="hello" \
-v "$PWD/examples/crontab_file:/crontab_file:ro" \
-v "$PWD/examples/scripts:/opt/scripts:ro" \
opendicom/dicomtools:local
docker logs -f dicomtools-cron
You should see TEST_VAR=hello in the job output.
This repo includes ready-to-use compose files under examples/.
Build the image first (or edit the compose files to use build: ..).
Run the cron example:
cd examples
docker compose up
Stop it with:
docker compose down
To follow logs in another terminal:
docker logs -f dicomtools-cron
If you prefer a faster feedback loop, temporarily change the schedule in examples/crontab_file to run more frequently.
Example crontab_file:
SHELL=/bin/bash
# All environment variables from the container are inherited by jobs.
# (So PATH set via Dockerfile ENV or `docker run -e ...` is available.)
* * * * * /opt/scripts/hello.sh
Note: avoid redirecting output to files if you want to see it in docker logs.
By default, the image starts with supercronic (see CMD in the Dockerfile). If you want to run an external script instead, you can override the container command in docker-compose.yml.
Run the command override example:
cd examples
docker compose -f docker-compose-cmd.yml up
Example docker-compose.yml:
services:
dicomtools:
image: opendicom/dicomtools:local
# or: build: .
environment:
TEST_VAR: "hola"
volumes:
- ./my-script.sh:/opt/scripts/my-script.sh:ro
command: ["/bin/bash", "-lc", "/opt/scripts/my-script.sh"]
Notes:
command: replaces the Dockerfile CMD.bash -lc still works.Content type
Image
Digest
sha256:295baf103…
Size
500.1 MB
Last updated
7 months ago
docker pull opendicom/dicomtools