Skip to content

SIRF SuperBuild on Docker

Casper da Costa-Luis edited this page Sep 14, 2017 · 26 revisions

Docker

Docker is a low-overhead, container-based replacement for virtual machines (VMs).

This works best on a linux system due to:

  1. Possibility to get CUDA support within the container
  2. X11 windows displayed natively without needing e.g. a vnc server or desktop in the container
  3. Really short installation instructions (see below)

Prerequisites

SIRF Container Building

Linux

For easier file and window sharing, the container should be built using the host user's ID and some environment variables.

SIRF-SuperBuild$ docker-compose -f docker-compose.yml -f docker-compose.nix.yml --build-arg UID=$(id -u) --build-arg GROUPS=$(id -g) build sirf
SIRF-SuperBuild$ docker-compose create

Windows

For the first step, instead of passing user IDs, Windows requires that file sharing is enabled.

SIRF-SuperBuild> docker-compose create

Usage

Well, that was easy. This will have pulled ubuntu:16.04, and fetched and built SIRF and all its dependencies into an image tagged in docker as ccppetmr/sirf. A container called sirf is then created based on this image. The container can be run interactively for daily use.

SIRF-SuperBuild$ docker-compose start -ai sirf
sirf:~$ gadgetron &
sirf:~$ python SIRF-SuperBuild/INSTALL/SIRF/examples/Python/MR/fully_sampled_recon.py

The first line starts the sirf docker container. The second line starts gadgetron within the container as a background process. Finally, we can then run an example. Note that the devel folder in the host's SIRF-SuperBuild directory is mounted to /devel in the container.

Notes

  • "Cannot connect to display" errors are usually fixed by running xhost +local:"" on the host linux system
  • Non-linux users (e.g. Windows) will need to set up a desktop and vnc server in order to have a GUI (docker files coming soon)