Skip to content

Running as a Docker Container

Michael Kober edited this page Nov 21, 2017 · 3 revisions

Building docker image from source

Slicebox uses sbt native packager to build a docker image based on "openjdk:8-jre-alpine". To build the image from sources run

sbt docker:publishLocal

Using base image

The slicebox docker image is available on dockerhub. It is based on Alpine Linux and uses openjdk 8.

docker pull slicebox/slicebox:1.4-latest-alpine

Custom configuration

The image uses default configuration, which is most likely not what you want (files and DB are stored in filesystem of the container). To use a custom configuration, you should either create your own image based on slicebox or mount your configuration as a volume.

Example Dockerfile with custom configuration

FROM slicebox/slicebox:1.4-latest-alpine

EXPOSE 8080

# custom config
ADD custom-slicebox.conf /opt/docker/conf/slicebox.conf

# custom log config
ADD custom-logback.xml /opt/docker/conf/logback.xml

Mounting configuration

docker run -p 5000:5000 --volume /absolute/path/to/conf:/opt/docker/conf slicebox/slicebox:1.4-latest-alpine

Mounting configuration and data directories

Mount a data directory if you want to store DICOM or DB data on filesystem of the docker host. Make sure to update your configuration (i.e. dicom-storage.file-system.path) accordingly.

docker run -p 5000:5000 --volume /absolute/path/to/data:/opt/docker/data --volume /absolute/path/to/conf:/opt/docker/conf slicebox/slicebox:1.4-latest-alpine