forked from KATRIN-Experiment/Kassiopeia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
63 lines (48 loc) · 1.65 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
# --- runtime-base ---
FROM fedora:38 as runtime-base
LABEL description="Runtime base container"
LABEL maintainer="jan.behrens@kit.edu"
COPY Docker/packages.runtime packages
RUN dnf update -y \
&& dnf install -y $(cat packages) \
&& rm /packages
# --- build-base ---
FROM runtime-base as build-base
LABEL description="Build base container"
COPY Docker/packages.build packages
RUN dnf update -y \
&& dnf install -y $(cat packages) \
&& rm /packages
# --- build ---
FROM build-base as build
LABEL description="Build container"
COPY . /usr/src/kasper
RUN cd /usr/src/kasper && \
mkdir -p build && \
pushd build && \
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=14 \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DBUILD_UNIT_TESTS=ON \
-DKASPER_USE_ROOT=ON \
-DKASPER_USE_VTK=ON \
-DKASPER_USE_TBB=OFF \
-DKEMField_USE_OPENCL=OFF \
.. && \
make -j $((($(nproc)+1)/2)) && \
make install && \
popd
# --- runtime ---
FROM runtime-base as runtime
LABEL description="Run container"
COPY --from=build /usr/local /usr/local
RUN echo "/usr/local/lib64" > /etc/ld.so.conf.d/local-x86_64.conf \
&& ldconfig
RUN strip --remove-section=.note.ABI-tag /usr/lib64/libQt5Core.so.5
WORKDIR /usr/local
RUN echo '#!/bin/bash' > /usr/local/bin/entrypoint.sh && \
echo '. /usr/local/bin/kasperenv.sh `pwd`' >> /usr/local/bin/entrypoint.sh && \
echo 'exec "$@"' >> /usr/local/bin/entrypoint.sh && \
chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["/usr/local/bin/entrypoint.sh","Kassiopeia"]