-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
62 lines (52 loc) · 2.09 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
ARG final_img_repo=ghcr.io/project8/luna_base
ARG final_img_tag=v1.3.4
ARG build_img_repo=ghcr.io/project8/luna_base
ARG build_img_tag=v1.3.4-dev
########################
FROM ${build_img_repo}:${build_img_tag} AS build
ARG build_type=Release
ARG build_tests_exe=FALSE
ARG katydid_subdir=katydid
ARG katydid_tag=beta
ARG nproc=4
ARG katydid_prefix=${P8_ROOT}/${katydid_subdir}/${katydid_tag}
ENV KATYDID_PREFIX=$katydid_prefix
RUN source ${COMMON_PREFIX}/setup.sh &&\
mkdir -p $KATYDID_PREFIX &&\
chmod -R 777 $KATYDID_PREFIX/.. &&\
cd $KATYDID_PREFIX &&\
echo "source ${COMMON_PREFIX}/setup.sh" > setup.sh &&\
echo "export KATYDID_TAG=${KATYDID_TAG}" >> setup.sh &&\
echo "export KATYDID_PREFIX=${KATYDID_PREFIX}" >> setup.sh &&\
echo 'ln -sfT $KATYDID_PREFIX $KATYDID_PREFIX/../current' >> setup.sh &&\
echo 'export PATH=$KATYDID_PREFIX/bin:$PATH' >> setup.sh &&\
echo 'export LD_LIBRARY_PATH=$KATYDID_PREFIX/lib:$LD_LIBRARY_PATH' >> setup.sh &&\
/bin/true
COPY Cicada /tmp_source/Cicada
COPY cmake /tmp_source/cmake
COPY Examples /tmp_source/Examples
COPY External /tmp_source/External
COPY Nymph /tmp_source/Nymph
COPY Source /tmp_source/Source
COPY CMakeLists.txt /tmp_source/CMakeLists.txt
COPY KatydidConfig.cmake.in /tmp_source/KatydidConfig.cmake.in
COPY KatydidConfig.hh.in /tmp_source/KatydidConfig.hh.in
COPY libkatydid.rootmap /tmp_source/libkatydid.rootmap
COPY this_katydid.sh.in /tmp_source/this_katydid.sh.in
COPY .git /tmp_source/.git
# repeat the cmake command to get the change of install prefix to set correctly (a package_builder known issue)
RUN source $KATYDID_PREFIX/setup.sh &&\
cd /tmp_source &&\
mkdir build &&\
cd build &&\
cmake .. &&\
cmake -D CMAKE_BUILD_TYPE=$build_type \
-D CMAKE_INSTALL_PREFIX:PATH=$KATYDID_PREFIX \
-D Katydid_ENABLE_TESTING:BOOL=$build_tests_exe \
-D CMAKE_SKIP_RPATH:BOOL=True .. &&\
make -j$nproc install &&\
/bin/true
########################
FROM ${final_img_repo}:${final_img_tag}
COPY --from=build $P8_ROOT $P8_ROOT
CMD source ${P8_ROOT}/katydid/current/setup.sh && /bin/bash