forked from ANTsX/ANTs
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
64 lines (54 loc) · 1.92 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
FROM ubuntu:bionic-20220427 as builder
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
apt-transport-https \
bc \
build-essential \
ca-certificates \
gnupg \
ninja-build \
git \
software-properties-common \
wget \
zlib1g-dev
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null \
| apt-key add - \
&& apt-add-repository -y 'deb https://apt.kitware.com/ubuntu/ bionic main' \
&& apt-get update \
&& apt-get -y install cmake=3.18.3-0kitware1 cmake-data=3.18.3-0kitware1
ADD . /tmp/ants/source
RUN mkdir -p /tmp/ants/build \
&& cd /tmp/ants/build \
&& mkdir -p /opt/ants \
&& git config --global url."https://".insteadOf git:// \
&& cmake \
-GNinja \
-DBUILD_TESTING=ON \
-DRUN_LONG_TESTS=OFF \
-DRUN_SHORT_TESTS=ON \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_INSTALL_PREFIX=/opt/ants \
/tmp/ants/source \
&& cmake --build . --parallel \
&& cd ANTS-build \
&& cmake --install .
# Need to set library path to run tests
ENV LD_LIBRARY_PATH="/opt/ants/lib:$LD_LIBRARY_PATH"
RUN cd /tmp/ants/build/ANTS-build \
&& cmake --build . --target test
FROM ubuntu:bionic-20220427
COPY --from=builder /opt/ants /opt/ants
LABEL maintainer="ANTsX team" \
description="ANTs is part of the ANTsX ecosystem (https://github.com/ANTsX). \
ANTs Citation: https://pubmed.ncbi.nlm.nih.gov/24879923"
ENV ANTSPATH="/opt/ants/bin" \
PATH="/opt/ants/bin:$PATH" \
LD_LIBRARY_PATH="/opt/ants/lib:$LD_LIBRARY_PATH"
RUN apt-get update \
&& apt install -y --no-install-recommends \
bc \
zlib1g-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
WORKDIR /data
CMD ["/bin/bash"]