-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
71 lines (57 loc) · 2.76 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
FROM ubuntu:latest as ismrmrd_base
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=America/Chicago
RUN apt-get update && apt-get install -y \
git cmake doxygen g++ graphviz ca-certificates \
libboost-all-dev libfftw3-dev libhdf5-serial-dev \
zlib1g-dev libxml2-utils libpugixml-dev libxslt1-dev libtls-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
|| cat /var/log/apt/term.log
#dump into /var/log/apt/term.log in case of a failure when building the image
ENV BUILDTOP /opt/code/ge_to_ismrmrd
ENV ISMRMRD_HOME $BUILDTOP/ismrmrd
# comment the following out if you want to try the latest revision of ismrmrd
ENV ISMRMRD_VERSION d364e03d3faa3ca516da7807713b5acc72218a37
ENV GE_TOOLS_HOME $BUILDTOP/ge-tools
ENV SDKTOP $BUILDTOP/orchestra-sdk
ENV HDF5_ROOT $SDKTOP/3p
RUN mkdir -p $BUILDTOP
COPY . $BUILDTOP
# extract Orchestra SDK
RUN cd $BUILDTOP && \
tar xzf orchestra-sdk*.tgz && \
rm orchestra-sdk*.tgz && \
mv orchestra-sdk* orchestra-sdk
# ISMRMRD library
RUN cd /opt/code && \
git clone https://github.com/ismrmrd/ismrmrd.git && \
cd ismrmrd && \
if [ -n "$ISMRMRD_VERSION" ]; then \
git checkout $ISMRMRD_VERSION;\
fi && \
echo -n "Using ISMRMRD commit ID: " && \
git rev-parse HEAD && \
mkdir build && \
cd build && \
cmake -D CMAKE_INSTALL_PREFIX=$ISMRMRD_HOME -D build4GE=TRUE -D Boost_NO_BOOST_CMAKE=TRUE -D Boost_NO_SYSTEM_PATHS=TRUE .. && \
make install
# ge_to_ismrmrd conveter
RUN cd $BUILDTOP && \
mkdir build && \
cd build && \
cmake -D CMAKE_INSTALL_PREFIX=$GE_TOOLS_HOME -D build4GE=TRUE -D Boost_NO_BOOST_CMAKE=TRUE -D Boost_NO_SYSTEM_PATHS=TRUE .. && \
make -j $(nproc) && \
make install
# Create archive of ISMRMRD libraries (including symlinks) for second stage
RUN cd $BUILDTOP/ismrmrd/lib && tar czvf libismrmrd.tgz libismrmrd*
# ----- Start another clean build without all of the build dependencies of ge_to_ismrmrd -----
FROM ubuntu:latest
ENV GE_TOOLS_HOME /opt/code/ge_to_ismrmrd/ge-tools
RUN apt-get update && apt-get install -y --no-install-recommends libfftw3-dev libxslt1.1 libgomp1 libpugixml1v5 && apt-get clean && rm -rf /var/lib/apt/lists/*
# Copy ge2ismrmrd from last stage and re-add necessary dependencies ($BUILDTOP does not work here)
COPY --from=ismrmrd_base /opt/code/ge_to_ismrmrd/ismrmrd/bin /usr/local/bin
COPY --from=ismrmrd_base /opt/code/ge_to_ismrmrd/ismrmrd/lib/libismrmrd.tgz /usr/local/lib/
COPY --from=ismrmrd_base /opt/code/ge_to_ismrmrd/ge-tools/bin/ge2ismrmrd /usr/local/bin
COPY --from=ismrmrd_base /opt/code/ge_to_ismrmrd/ge-tools/lib/libg2i.so /usr/local/lib/
COPY --from=ismrmrd_base /opt/code/ge_to_ismrmrd/ge-tools/ /opt/code/ge_to_ismrmrd/ge-tools/
RUN cd /usr/local/lib && tar xzf libismrmrd.tgz && rm -f libismrmrd.tgz && ldconfig