Commit 5870051a authored by GILLES Sebastien's avatar GILLES Sebastien

#1509 Remove Docker generation, as it is handled by a brand new sibling...

#1509 Remove Docker generation, as it is handled by a brand new sibling project. A line has been added in the README.
parent 97311126
Pipeline #125379 passed with stages
in 2 minutes and 4 seconds
# ================================================================================================================
# 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.
# ================================================================================================================
ARG os
ARG mode
ARG compiler
ARG is_single_library
ARG library_type
FROM registry.gitlab.inria.fr/morefem/thirdpartycompilationfactory/${os}-${compiler}-${mode} AS third_party_container
LABEL maintainer Sébastien Gilles "sebastien.gilles@inria.fr"
# Repeat is mandatory here - see https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
ARG os
ARG mode
ARG compiler
ARG is_single_library
ARG library_type
USER root
WORKDIR MoReFEM
RUN mkdir -p build_docker
RUN chmod 777 build_docker /opt
USER ${USER}
COPY Sources Sources
COPY cmake cmake
COPY Scripts Scripts
COPY CMakeLists.txt CMakeLists.txt
COPY Data Data
WORKDIR build_docker
RUN python ../cmake/Scripts/configure_cmake.py --cache_file=../cmake/PreCache/linux.cmake --cmake_args="-G Ninja" --install_directory=/opt --third_party_directory=/opt --morefem_as_single_library=${is_single_library} --mode=${mode} --library_type=${library_type}
RUN ninja
RUN ctest
RUN ninja install
WORKDIR /home/non_root_user/Codes
USER root
RUN rm -rf MoReFEM /tmp/*
USER ${USER}
FROM registry.gitlab.inria.fr/morefem/thirdpartycompilationfactory/${os}-${compiler}-${mode}
COPY --from=third_party_container /opt/MoReFEM /opt/MoReFEM
\ No newline at end of file
# Purpose of the Dockerfile
The provided Dockerfile aims to build images of tag versions of MoReFEM that will be saved in the registry of the [Gitlab project](https://gitlab.inria.fr/MoReFEM/CoreLibrary/MoReFEM).
A generated image is an extension of an image from [third party compilation project](https://gitlab.inria.fr/MoReFEM/ThirdPartyCompilationFactory) for which the installed MoReFEM has been added.
As the purpose is to provide a functioning MoReFEM at a minimal storge cost, only the installed libraries and executables are kept; source files are not (but of course you're free to get them back with git on a contained based on the provided image).
# Generation of the images
The Dockerfile in _Docker/Dockerfile_ is used to generate the image with dedicated args. Let's assume you have define a variable MOREFEM_TAG with a value such as vXX.YY (for instance v19.48):
For instance (when run from the root of the project):
````
DOCKER_BUILDKIT=1 docker build -t registry.gitlab.inria.fr/morefem/corelibrary/morefem/ubuntu_gcc_debug_shared --progress=plain -f Docker/Dockerfile --build-arg os=ubuntu --build-arg mode=debug --build-arg compiler=gcc --build-arg is_single_library=False --build-arg library_type=shared .
docker tag registry.gitlab.inria.fr/morefem/corelibrary/morefem/ubuntu_gcc_debug_shared registry.gitlab.inria.fr/morefem/corelibrary/morefem/ubuntu_gcc_debug_shared:${MOREFEM_TAG}
DOCKER_BUILDKIT=1 docker build -t registry.gitlab.inria.fr/morefem/corelibrary/morefem/fedora_clang_release_shared --progress=plain -f Docker/Dockerfile --build-arg os=fedora --build-arg mode=release --build-arg compiler=clang --build-arg is_single_library=True --build-arg library_type=shared .
docker tag registry.gitlab.inria.fr/morefem/corelibrary/morefem/fedora_clang_release_shared registry.gitlab.inria.fr/morefem/corelibrary/morefem/fedora_clang_release_shared:${MOREFEM_TAG}
DOCKER_BUILDKIT=1 docker build -t registry.gitlab.inria.fr/morefem/corelibrary/morefem/fedora_clang_debug_shared --progress=plain -f Docker/Dockerfile --build-arg os=fedora --build-arg mode=debug --build-arg compiler=clang --build-arg is_single_library=False --build-arg library_type=shared .
docker tag registry.gitlab.inria.fr/morefem/corelibrary/morefem/fedora_clang_debug_shared registry.gitlab.inria.fr/morefem/corelibrary/morefem/fedora_clang_debug_shared:${MOREFEM_TAG}
````
# Putting images on registry
For instance:
````
docker login registry.gitlab.inria.fr
docker push registry.gitlab.inria.fr/morefem/corelibrary/morefem/fedora_clang_debug_shared
````
# Example of using an image
````
docker run -it registry.gitlab.inria.fr/morefem/corelibrary/morefem/fedora_clang_debug_shared
````
And inside the container clone a model and run its tests:
````
git clone https://gitlab.inria.fr/MoReFEM/Models/AcousticWave
cd AcousticWave
mkdir build
cd build
python /opt/MoReFEM/cmake/configure_cmake_external_model.py --morefem_install_dir=/opt/MoReFEM --cmake_args="-G Ninja"
ninja
ctest
````
......@@ -200,6 +200,11 @@ ninja test
and both unit tests and sanity checks for the basic models should be run. Those tests are designed to run in a couple of minutes (with of course strong dependency of the compilation mode chosen).
# Docker images
Recently, we started releasing Docker images at each tag Currently they are located in a [sibling project](https://gitlab.inria.fr/MoReFEM/CoreLibrary/generatedockerimages/container_registry); they should be in registry of current project as soon as the functionality is available in Gitlab (ticket #1509).
# Using MoReFEM
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment