forked from BioMedIA/MIRTK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
90 lines (82 loc) · 3.17 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
## 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 --build-arg VCS_REF=`git rev-parse --short HEAD` -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 <[email protected]>
LABEL Description="Medical Image Registration ToolKit (MIRTK)" Vendor="BioMedIA"
# Git repository and commit SHA from which this Docker image was built
# (see https://microbadger.com/#/labels)
ARG VCS_REF
LABEL org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/BioMedIA/MIRTK"
# 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_SHARED_LIBS=ON \
-D BUILD_APPLICATIONS=ON \
-D BUILD_TESTING=${BUILD_TESTING} \
-D BUILD_DOCUMENTATION=OFF \
-D BUILD_CHANGELOG=OFF \
-D MODULE_Common=ON \
-D MODULE_Numerics=ON \
-D MODULE_Image=ON \
-D MODULE_IO=ON \
-D MODULE_PointSet=ON \
-D MODULE_Transformation=ON \
-D MODULE_Registration=ON \
-D MODULE_Deformable=ON \
-D MODULE_DrawEM=ON \
-D MODULE_Mapping=ON \
-D MODULE_Scripting=ON \
-D MODULE_SVRTK=ON \
-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