forked from BioMedIA/MIRTK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
73 lines (66 loc) · 2.58 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
## Build Docker image for execution of MIRTK commands within a Docker
## container with all modules and applications available in the image
##
## How to build the image:
## - Change to top-level directory of MIRTK source tree
## - Run "docker build -t <user>/mirtk:latest ."
##
## Upload image to Docker Hub:
## - Log in with "docker login" if necessary
## - Push image using "docker push <user>/mirtk:latest"
##
## Note: The "biomedia/mirtk" repository on Docker Hub is automatically
## updated with a new Docker image build when a change is committed
## to the (develop/master) branch of the MIRTK GitHub repository.
## Pushing manually build images to biomedia/mirtk is not possible
## (unless the automatic build has been replaced by a manual build).
##
## https://hub.docker.com/r/biomedia/mirtk/
# Pre-made Ubuntu system with all MIRTK dependencies installed
FROM biomedia/ubuntu:mirtk
MAINTAINER Andreas Schuh <andreas.schuh.84@gmail.com>
LABEL Description="Medical Image Registration ToolKit (MIRTK)" Vendor="BioMedIA"
# No. of threads to use for build (--build-arg THREADS=8)
# By default, all available CPUs are used. When a Docker Machine is used,
# set the number of CPUs in the VirtualBox VM Settings.
ARG THREADS
# Whether to build and run MIRTK tests before installation
# Override default with docker build --build-arg BUILD_TESTING=ON
ARG BUILD_TESTING=OFF
# Build and install MIRTK
COPY . /usr/src/MIRTK
RUN ls /usr/src/MIRTK \
&& NUM_CPUS=${THREADS:-`cat /proc/cpuinfo | grep processor | wc -l`} \
&& echo "Maximum number of build threads = $NUM_CPUS" \
&& mkdir /usr/src/MIRTK/Build \
&& cd /usr/src/MIRTK/Build \
&& cmake \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D CMAKE_BUILD_TYPE=Release \
-D BUILD_ALL_MODULES=ON \
-D BUILD_SHARED_LIBS=ON \
-D BUILD_APPLICATIONS=ON \
-D BUILD_TESTING=${BUILD_TESTING} \
-D BUILD_DOCUMENTATION=OFF \
-D BUILD_CHANGELOG=OFF \
-D WITH_ARPACK=ON \
-D WITH_FLANN=ON \
-D WITH_MATLAB=OFF \
-D WITH_NiftiCLib=ON \
-D WITH_PNG=ON \
-D WITH_PROFILING=ON \
-D WITH_TBB=ON \
-D WITH_UMFPACK=ON \
-D WITH_VTK=ON \
-D WITH_ZLIB=ON \
.. \
&& if [ ${BUILD_TESTING} = ON ]; then make -j $NUM_CPUS && make test; fi \
&& make -j $NUM_CPUS install \
&& cd /usr/src \
&& rm -rf /usr/src/MIRTK
# Make "mirtk" the default executable for application containers
ENTRYPOINT ["python", "/usr/local/bin/mirtk"]
CMD ["help"]
# Assume user data volume to be mounted at /data
# docker run --volume=/path/to/data:/data
WORKDIR /data