-
Notifications
You must be signed in to change notification settings - Fork 88
/
Dockerfile
45 lines (39 loc) · 1.15 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
# Dockerfile for EvaluateSegmentation.
#
# Build image:
# docker build --tag evaluatesegmentation .
#
# Run image:
# docker run --rm -it -v $PWD:/data evaluatesegmentation /data/reference.nii.gz /data/segmentation.nii.gz
ARG MAKE_JOBS=1
FROM alpine:3.12.0 AS base
FROM base AS builder
RUN apk add --no-cache \
cmake \
g++ \
gcc \
git \
linux-headers \
make \
perl
ARG MAKE_JOBS
WORKDIR /opt/itk-src
RUN wget -O- -q https://github.com/InsightSoftwareConsortium/ITK/releases/download/v5.1.1/InsightToolkit-5.1.1.tar.gz \
| tar xz --strip 1 \
&& mkdir build \
&& cd build \
&& cmake -DCMAKE_INSTALL_PREFIX=/opt/itk -DCMAKE_COLOR_MAKEFILE=OFF .. \
&& make --jobs "$MAKE_JOBS" \
&& make install
WORKDIR /opt/evaluate-segmentation
COPY . .
RUN mkdir build \
&& cd build \
&& cmake -DITK_DIR=/opt/itk/lib/cmake/ITK-5.1 ../source \
&& make --jobs "$MAKE_JOBS"
FROM base
COPY --from=builder /opt/evaluate-segmentation/build/EvaluateSegmentation /usr/local/bin/
RUN apk add --no-cache libgcc libstdc++
WORKDIR /work
ENTRYPOINT ["/usr/local/bin/EvaluateSegmentation"]
CMD ["--help"]