Dockerfile.clang.debug 2.63 KB
Newer Older
1 2 3 4
# ================================================================================================================
# This Dockerfile assumes a local image onto which third party libraries are built properly is available.
# See https://gitlab.inria.fr/MoReFEM/ThirdPartyCompilationFactory to see how it was generated.
# ================================================================================================================
5
FROM third_party_4_morefem_fedora_clang_debug
6
LABEL maintainer Sébastien Gilles "sebastien.gilles@inria.fr"
7 8


9 10 11
ARG branch


12 13 14 15
# ================================================================================================================
# Install required tools
# ================================================================================================================
USER root
16
RUN dnf install -y ninja-build
17 18 19

# Adapted from https://askubuntu.com/questions/952429/is-there-are-good-ppa-for-cmake-backports
# We need cmake >= 3.8 and Ubuntu ships 3.5...
20 21 22
RUN curl -O https://cmake.org/files/v3.12/cmake-3.12.1-Linux-x86_64.sh \
    && sh cmake-3.12.1-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir \
    && rm -f cmake-3.12.1-Linux-x86_64.sh
23
    
24

25 26 27 28
# ================================================================================================================
# Clone the MoReFEM repository.
# ================================================================================================================
USER ${USER}
29

30 31 32 33 34 35
# Check 'branch' has properly be transmitted to the Dockerfile.
# See https://stackoverflow.com/questions/38438933/how-to-make-a-build-arg-mandatory-during-docker-build.
RUN test -n "${branch}"

RUN git clone -b ${branch} https://gitlab.inria.fr/MoReFEM/CoreLibrary/MoReFEM
WORKDIR MoReFEM
36

37 38 39 40 41 42
# ================================================================================================================
# Build all the targets in the project.
# Tests should be run to be sure in a container (through ctest in the build directory) but are not here to save
# space in the generated image.
# ================================================================================================================
RUN mkdir build
43
WORKDIR build
44
RUN python ../cmake/Scripts/configure_cmake.py --cache_file=../cmake/PreCache/linux.cmake --cmake_args="-G Ninja"  --install_directory=/opt/MoReFEM --third_party_directory=/opt --morefem_as_single_library=False --mode="Debug"
45

46
RUN ninja -j 4
47
    
48

49 50 51 52
# The two lines below should be run in a container but are not in the image creation to save space (tests do 
# generate outputs and installation basically duplicates libraries and executables generated).
#RUN ninja install
#RUN ninja test