-
Notifications
You must be signed in to change notification settings - Fork 29
SIRF SuperBuild on Docker
Docker is a low-overhead, container-based replacement for virtual machines (VMs).
This works best on a linux system due to:
- Possibility to get CUDA support within the container
- X11 windows displayed natively without needing e.g. a vnc server or desktop in the container
- Really short installation instructions (see below)
- Docker
- The free Community Edition (CE) is sufficient
- Optional but recommended: to build from source
The docker image can be built from source using CCPPETMR/SIRF-SuperBuild
and docker-compose
by following the steps below. Alternatively, simply run docker pull ccppetmr/sirf
to download the pre-built image.
For easier file and window sharing, the container should be built using the host user's ID and some environment variables.
SIRF-SuperBuild/docker$ docker-compose -f docker-compose.yml \
-f docker-compose.nix.yml build \
--build-arg UID=$(id -u) --build-arg GROUPS=$(id -g) sirf
SIRF-SuperBuild/docker$ docker-compose create
For the first step, instead of passing user IDs, Windows requires that file sharing is enabled.
SIRF-SuperBuild/docker> docker-compose create
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$ docker-compose start -ai sirf
sirf:~$ gadgetron &
sirf:~$ python SIRF-SuperBuild/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/docker
directory is mounted to /devel
in the container.
- "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)
- On host systems with less than 16GB RAM, before
docker-compose create
you may want to editSIRF-SuperBuild/docker/user_sirf-ubuntu.sh
, changing the linemake -j
to simplymake
. This increases build time and reduces build memory requirements.