@@ -2,13 +2,15 @@ FROM ubuntu:24.04 AS base_image
22USER root
33SHELL ["/bin/bash" , "-c" ]
44ENV DEBIAN_FRONTEND=noninteractive
5- # We set a sensical value, but still have the possibilty to influence this via the build time arguments.
5+ # We set a sensical value, but still have the possibilty to influence this via the build time arguments.
66# When the dockerfile is built using the systemtests.py we set the PRECICE_UID and PRECICE_GID to the user executing the systemtests.
77# This ensures no file ownership problems down the line and is the most easy fix, as we normally built the containers locally
88# If not built via the systemtests.py its either possible to specify manually but 1000 would be the default anyway.
99ARG PRECICE_UID=1000
1010ARG PRECICE_GID=1000
11- RUN groupadd -g ${PRECICE_GID} precice && useradd -u ${PRECICE_UID} -g ${PRECICE_GID} -ms /bin/bash precice
11+ # Ubuntu 24.04+ images include a default user "ubuntu" with UID/GID 1000; remove it so we can create "precice" with the same UID/GID.
12+ RUN userdel -r ubuntu 2>/dev/null || true; groupdel ubuntu 2>/dev/null || true; \
13+ groupadd -g ${PRECICE_GID} precice && useradd -u ${PRECICE_UID} -g ${PRECICE_GID} -ms /bin/bash precice
1214ENV PATH="${PATH}:/home/precice/.local/bin"
1315ENV LD_LIBRARY_PATH="/home/precice/.local/lib:${LD_LIBRARY_PATH}"
1416ENV CPATH="/home/precice/.local/include:$CPATH"
@@ -70,7 +72,7 @@ RUN apt-get update &&\
7072USER precice
7173COPY --from=precice /home/precice/.local/ /home/precice/.local/
7274ARG OPENFOAM_ADAPTER_PR
73- ARG OPENFOAM_ADAPTER_REF
75+ ARG OPENFOAM_ADAPTER_REF=master
7476# Build the OpenFOAM adapter
7577USER precice
7678WORKDIR /home/precice
@@ -83,7 +85,7 @@ RUN git clone https://github.com/precice/openfoam-adapter.git &&\
8385
8486FROM precice_dependecies AS python_bindings
8587COPY --from=precice /home/precice/.local/ /home/precice/.local/
86- ARG PYTHON_BINDINGS_REF
88+ ARG PYTHON_BINDINGS_REF=master
8789USER precice
8890WORKDIR /home/precice
8991# Builds the precice python bindings for python3
@@ -100,7 +102,7 @@ RUN add-apt-repository -y ppa:fenics-packages/fenics && \
100102 apt-get -qq update && \
101103 apt-get -qq install --no-install-recommends fenics
102104USER precice
103- ARG FENICS_ADAPTER_REF
105+ ARG FENICS_ADAPTER_REF=master
104106# Building fenics-adapter
105107RUN python3 -m venv --system-site-packages /home/precice/venv && \
106108 . /home/precice/venv/bin/activate && \
@@ -125,12 +127,12 @@ ARG CALCULIX_VERSION
125127USER precice
126128# Download Calculix
127129WORKDIR /home/precice
128- RUN wget http://www.dhondt.de/ccx_${CALCULIX_VERSION}.src.tar.bz2 && \
130+ RUN wget --tries=3 --retry-connrefused --timeout=30 http://www.dhondt.de/ccx_${CALCULIX_VERSION}.src.tar.bz2 && \
129131 tar xvjf ccx_${CALCULIX_VERSION}.src.tar.bz2 && \
130132 rm -fv ccx_${CALCULIX_VERSION}.src.tar.bz2
131133
132134ARG CALCULIX_ADAPTER_PR
133- ARG CALCULIX_ADAPTER_REF
135+ ARG CALCULIX_ADAPTER_REF=master
134136WORKDIR /home/precice
135137RUN git clone https://github.com/precice/calculix-adapter.git && \
136138 cd calculix-adapter && \
@@ -150,13 +152,13 @@ USER precice
150152# Download and build SU2 (We could also use pre-built binaries from the SU2 releases)
151153# The sed command applies a patch needed for Ubuntu 24.04.
152154WORKDIR /home/precice
153- RUN wget https://github.com/su2code/SU2/archive/refs/tags/v${SU2_VERSION}.tar.gz && \
155+ RUN wget --tries=3 --retry-connrefused --timeout=30 https://github.com/su2code/SU2/archive/refs/tags/v${SU2_VERSION}.tar.gz && \
154156 tar xvzf v${SU2_VERSION}.tar.gz && \
155157 rm -fv v${SU2_VERSION}.tar.gz
156158RUN python3 -m venv /home/precice/venv && \
157159 . /home/precice/venv/bin/activate
158160ARG SU2_ADAPTER_PR
159- ARG SU2_ADAPTER_REF
161+ ARG SU2_ADAPTER_REF=master
160162WORKDIR /home/precice
161163ENV SU2_RUN="/home/precice/SU2_RUN"
162164ENV SU2_HOME="/home/precice/SU2-${SU2_VERSION}"
@@ -179,7 +181,7 @@ RUN apt-get update &&\
179181USER precice
180182COPY --from=precice /home/precice/.local/ /home/precice/.local/
181183ARG DEALII_ADAPTER_PR
182- ARG DEALII_ADAPTER_REF
184+ ARG DEALII_ADAPTER_REF=master
183185# Build the deal.II adapter
184186USER precice
185187WORKDIR /home/precice
@@ -189,4 +191,4 @@ RUN git clone https://github.com/precice/dealii-adapter.git &&\
189191 if [ -n "${DEALII_ADAPTER_PR}" ]; then git fetch origin pull/${DEALII_ADAPTER_PR}/head; fi && \
190192 git checkout ${DEALII_ADAPTER_REF} && \
191193 cmake . && \
192- make -j $(nproc)
194+ make -j $(nproc)
0 commit comments