Skip to content

Commit

Permalink
Merge pull request #16062 from marcfehling/docker
Browse files Browse the repository at this point in the history
Docker: Build images with different number of jobs.
  • Loading branch information
marcfehling committed Sep 30, 2023
2 parents ac1550e + fe3df26 commit 191d80e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ jobs:
strategy:
fail-fast: false
matrix:
ubuntu_version: ["focal", "jammy"]
ubuntu_version: [focal, jammy]
# Use 2 jobs to build, but only 1 for the focal image
# as it starves the github machine for memory.
include:
- n_jobs: 2
- n_jobs: 1
ubuntu_version: focal

steps:
- name: Checkout code
Expand All @@ -40,7 +46,8 @@ jobs:
cache-from: type=registry,ref=dealii/dependencies:${{ matrix.ubuntu_version }}
cache-to: type=inline
build-args: |
VER=master
IMG=${{ matrix.ubuntu_version }}
push: ${{github.ref_name == 'master'}}
NJOBS=${{ matrix.n_jobs }}
VER=master
push: ${{ github.ref_name == 'master' }}
tags: dealii/dealii:master-${{ matrix.ubuntu_version }}
13 changes: 7 additions & 6 deletions contrib/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
ARG IMG=focal
ARG IMG=focal # Ubuntu image that contains all corresponding dependencies.
ARG NJOBS=0 # Jobs used for building. Default: Use all available jobs.
ARG VER=master # deal.II branch that gets checked out.

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 dealii-$VER && \
cd dealii-$VER && \
Expand Down Expand Up @@ -49,9 +50,9 @@ RUN cd /usr/src && \
-DDEAL_II_WITH_UMFPACK=ON \
-DDEAL_II_WITH_VTK=ON \
-DDEAL_II_WITH_ZLIB=ON \
.. \
&& ninja -j 1 install \
&& cd ../ && rm -rf .git build
.. && \
ninja -j $NJOBS install && \
cd ../ && rm -rf .git build

USER $USER
WORKDIR $HOME

0 comments on commit 191d80e

Please sign in to comment.