From adf2098703692eb472e62732866e4162e287815d Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Tue, 11 Apr 2023 09:00:39 +0300 Subject: [PATCH] Build both focal and jammy images. --- .github/workflows/docker.yml | 17 ++++++++++++++++- contrib/docker/Dockerfile | 16 +++++++++++----- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 3885ea87e0..b3b3148e06 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -26,11 +26,26 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Build and push Docker image of master + - name: Build and push Docker image of master focal uses: docker/build-push-action@v4 with: context: ./contrib/docker/ cache-from: type=registry,ref=dealii/dependencies:focal cache-to: type=inline + build-args: | + VER=master + IMG=focal push: ${{github.ref_name == 'master'}} tags: dealii/dealii:master-focal + + - name: Build and push Docker image of master jammy + uses: docker/build-push-action@v4 + with: + context: ./contrib/docker/ + cache-from: type=registry,ref=dealii/dependencies:jammy + cache-to: type=inline + build-args: | + VER=master + IMG=jammy + push: ${{github.ref_name == 'master'}} + tags: dealii/dealii:master-jammy diff --git a/contrib/docker/Dockerfile b/contrib/docker/Dockerfile index 9ba8fca5c5..2893cd2cfb 100644 --- a/contrib/docker/Dockerfile +++ b/contrib/docker/Dockerfile @@ -1,12 +1,18 @@ -FROM dealii/dependencies:focal +ARG IMG=focal + +FROM dealii/dependencies:$IMG LABEL maintainer="luca.heltai@gmail.com" +ARG VER=master + USER root -RUN cd /usr/src \ - && git clone https://github.com/dealii/dealii \ - && cd dealii && mkdir build && cd build \ - && cmake -GNinja \ +RUN cd /usr/src && \ + git clone https://github.com/dealii/dealii dealii-$VER && \ + cd dealii-$VER && \ + git checkout $VER && \ + mkdir build && cd build && \ + cmake -GNinja \ -DCMAKE_PREFIX_PATH="/usr/lib/x86_64-linux-gnu/hdf5/openmpi;/usr/include/hdf5/openmpi" \ -DDEAL_II_ALLOW_AUTODETECTION=OFF \ -DDEAL_II_COMPILE_EXAMPLES=OFF \ -- 2.39.5