Revert 5 commits, rolling back to 20b1ef95c7

This commit is contained in:
Magne Sjaastad committed 2026-05-24 18:24:35 +02:00
1 parent dfc007e54e
commit bb49381997
6 files changed
+120 -981

No files matched your search

-284
View File
@@ -1,284 +0,0 @@
# syntax=docker/dockerfile:1
# =============================================================================
# Ubuntu 24.04 CI image for ResInsight.
#
# Bakes in:
# * Both toolchains used by the cache workflow's Linux legs: gcc-14 from
# Ubuntu's repos and clang-19 from the upstream LLVM apt repo.
# * Qt 6.7.0 via aqtinstall.
# * buildcache built from source (same v0.33.0 as the RHEL8 image, so the
# two images produce identical buildcache hashes for shared TUs).
# * A vcpkg binary cache per compiler at /opt/vcpkg-cache-{gcc,clang}.
# * A warm ResInsight buildcache per compiler at /opt/buildcache-{gcc,clang},
# populated by full builds at the fixed path /src -> /src/cmakebuild so
# consumer workflows can clone into /src and get cache hits.
#
# Consumed by:
# * .github/workflows/ResInsightWithCacheLinuxContainer.yml (matrix over
# both compilers).
# * .github/workflows/copilot-setup-steps.yml (Copilot Coding Agent;
# defaults to gcc-14 via the ENV block at the bottom of this file).
#
# Rebuilt nightly by .github/workflows/build-ubuntu24-image.yml.
# =============================================================================
# -----------------------------------------------------------------------------
# Stage 1: base toolchain (both compilers + Qt + buildcache).
# -----------------------------------------------------------------------------
FROM ubuntu:24.04 AS base
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV DEBIAN_FRONTEND=noninteractive \
LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
PIP_BREAK_SYSTEM_PACKAGES=1
# Base development tools and Qt/GL runtime/headers. The package list mirrors
# the apt step in ResInsightWithCache.yml + copilot-setup-steps.yml, plus the
# xcb/font/x11 *-dev packages Qt 6 needs at build link time (the runner image
# happens to have most of these preinstalled; the bare ubuntu:24.04 image does
# not).
RUN apt-get update --option="APT::Acquire::Retries=3" \
&& apt-get install -y --no-install-recommends --option="APT::Acquire::Retries=3" \
build-essential ninja-build cmake git curl wget ca-certificates \
zip unzip tar xz-utils pkg-config gnupg lsb-release \
flex bison autoconf automake libtool perl \
python3.12 python3.12-venv python3-pip \
libxkbcommon-x11-0 libxkbcommon-dev \
libgl1-mesa-dev mesa-common-dev libegl1-mesa-dev libglu1-mesa-dev libglfw3-dev \
libhdf5-dev \
libxcb1-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-icccm4-dev \
libxcb-render-util0-dev libxcb-render0-dev libxcb-shape0-dev \
libxcb-randr0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xkb-dev \
libxcb-shm0-dev libxcb-cursor0 libxkbcommon-x11-dev \
libfontconfig1-dev libfreetype-dev \
libx11-dev libxext-dev libxrender-dev libxi-dev libxcursor-dev \
libdbus-1-3 libnss3 libglib2.0-0t64 \
&& rm -rf /var/lib/apt/lists/*
# gcc-14 is in Ubuntu 24.04's repositories; no extra source needed.
RUN apt-get update --option="APT::Acquire::Retries=3" \
&& apt-get install -y --no-install-recommends --option="APT::Acquire::Retries=3" \
gcc-14 g++-14 \
&& rm -rf /var/lib/apt/lists/*
# clang-19 from the upstream LLVM apt repo. Mirrors the install block at
# ResInsightWithCache.yml:156-183 so the image's clang matches what the
# non-containerized leg used to install at runtime.
RUN wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key \
| gpg --dearmor -o /usr/share/keyrings/llvm-snapshot.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/llvm-snapshot.gpg] http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main" \
> /etc/apt/sources.list.d/llvm-19.list \
&& apt-get update --option="APT::Acquire::Retries=3" \
&& apt-get install -y --no-install-recommends --option="APT::Acquire::Retries=3" \
clang-19 lldb-19 lld-19 clangd-19 clang-tidy-19 clang-format-19 clang-tools-19 \
libc++-19-dev libc++abi-19-dev libomp-19-dev \
&& rm -rf /var/lib/apt/lists/* \
&& clang-19 --version
# Python tooling. PEP 668 marks the system Python as externally managed; for
# a single-purpose CI image --break-system-packages is the cleanest path and
# avoids a venv activation dance in every consumer workflow. grpcio-tools is
# needed at warmup time (RESINSIGHT_ENABLE_GRPC=ON). Pip itself is left at the
# system version (24.x): the Debian package has no RECORD file so pip cannot
# uninstall it for an upgrade, and the system version is recent enough to
# install everything we need.
RUN python3 -m pip install --no-cache-dir --break-system-packages \
aqtinstall grpcio-tools
# Qt 6.7.0 -- same version the cache workflow's Linux legs install via
# CeetronSolutions/install-qt-action. For Qt 6.7+ the aqt arch flag is
# `linux_gcc_64`; the install directory it produces is still `gcc_64`.
ARG QT_VERSION=6.7.0
RUN aqt install-qt linux desktop "${QT_VERSION}" linux_gcc_64 \
-O /opt/Qt --modules qtnetworkauth
ENV Qt6_DIR=/opt/Qt/${QT_VERSION}/gcc_64 \
CMAKE_PREFIX_PATH=/opt/Qt/${QT_VERSION}/gcc_64 \
PATH=/opt/Qt/${QT_VERSION}/gcc_64/bin:${PATH}
# buildcache binary release from the canonical GitLab repo (the GitHub mirror
# is stale at v0.28.4; GitLab progressed to v0.33.0 with the GCC 14
# transitive-include fixes). Ubuntu 24.04 ships glibc 2.39 so the precompiled
# linux-amd64 binary loads cleanly -- no need for the build-from-source detour
# the RHEL8 image takes. On PATH, so CMakeLists.txt auto-wires it as
# CMAKE_CXX_COMPILER_LAUNCHER via find_program().
ARG BUILDCACHE_VERSION=v0.33.0
RUN curl -fsSL -o /tmp/buildcache.tar.gz \
"https://gitlab.com/api/v4/projects/bits-n-bites%2Fbuildcache/packages/generic/releases/${BUILDCACHE_VERSION}/buildcache-linux-amd64.tar.gz" \
&& tar -xzf /tmp/buildcache.tar.gz -C /tmp \
&& install -m 0755 /tmp/buildcache/bin/buildcache /usr/local/bin/buildcache \
&& rm -rf /tmp/buildcache /tmp/buildcache.tar.gz \
&& buildcache --version
# -----------------------------------------------------------------------------
# Stage 2: populate the vcpkg binary cache with the gcc-14 toolchain.
# -----------------------------------------------------------------------------
FROM base AS vcpkg-builder-gcc
ENV VCPKG_DEFAULT_BINARY_CACHE=/opt/vcpkg-cache-gcc
COPY . /src
# Running the ResInsight CMake configure triggers a vcpkg manifest install,
# which compiles every dependency into VCPKG_DEFAULT_BINARY_CACHE. The configure
# step may then fail past the dependency build; that's tolerated because the
# binary cache is already populated by then. After configure, verify the cache
# contains a plausible number of entries -- ResInsight depends on ~30+ packages,
# so a threshold of 20 catches the failure mode where configure dies early
# (e.g. after building only a handful of leaf deps).
RUN git config --global --add safe.directory '*' \
&& mkdir -p "${VCPKG_DEFAULT_BINARY_CACHE}" \
&& ( cd /src/ThirdParty/vcpkg && ./bootstrap-vcpkg.sh ) \
&& export CC=gcc-14 CXX=g++-14 \
&& { cmake -S /src -B /tmp/cfg-gcc -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DRESINSIGHT_INCLUDE_APPLICATION_UNIT_TESTS=true \
-DRESINSIGHT_ENABLE_UNITY_BUILD=false \
-DRESINSIGHT_ENABLE_HDF5=false \
-DRESINSIGHT_ENABLE_GRPC=true \
-DRESINSIGHT_GRPC_DOWNLOAD_PYTHON_MODULE=true \
-DCMAKE_TOOLCHAIN_FILE=ThirdParty/vcpkg/scripts/buildsystems/vcpkg.cmake \
|| true; } \
&& vcpkg_zip_count=$(find "${VCPKG_DEFAULT_BINARY_CACHE}" -type f -name '*.zip' | wc -l) \
&& echo "vcpkg gcc binary cache entries: ${vcpkg_zip_count}" \
&& test "${vcpkg_zip_count}" -ge 20 \
&& rm -rf /tmp/cfg-gcc /src
# -----------------------------------------------------------------------------
# Stage 3: populate the vcpkg binary cache with the clang-19 toolchain.
# Independent stage so BuildKit can run it in parallel with Stage 2.
# -----------------------------------------------------------------------------
FROM base AS vcpkg-builder-clang
ENV VCPKG_DEFAULT_BINARY_CACHE=/opt/vcpkg-cache-clang
COPY . /src
RUN git config --global --add safe.directory '*' \
&& mkdir -p "${VCPKG_DEFAULT_BINARY_CACHE}" \
&& ( cd /src/ThirdParty/vcpkg && ./bootstrap-vcpkg.sh ) \
&& export CC=clang-19 CXX=clang++-19 \
&& { cmake -S /src -B /tmp/cfg-clang -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DRESINSIGHT_INCLUDE_APPLICATION_UNIT_TESTS=true \
-DRESINSIGHT_ENABLE_UNITY_BUILD=false \
-DRESINSIGHT_ENABLE_HDF5=false \
-DRESINSIGHT_ENABLE_GRPC=true \
-DRESINSIGHT_GRPC_DOWNLOAD_PYTHON_MODULE=true \
-DCMAKE_TOOLCHAIN_FILE=ThirdParty/vcpkg/scripts/buildsystems/vcpkg.cmake \
|| true; } \
&& vcpkg_zip_count=$(find "${VCPKG_DEFAULT_BINARY_CACHE}" -type f -name '*.zip' | wc -l) \
&& echo "vcpkg clang binary cache entries: ${vcpkg_zip_count}" \
&& test "${vcpkg_zip_count}" -ge 20 \
&& rm -rf /tmp/cfg-clang /src
# -----------------------------------------------------------------------------
# Stage 4: warm the ResInsight buildcache for gcc-14.
#
# Full compile at /src -> /src/cmakebuild. Consumer workflows clone into the
# same /src so buildcache hashes (which include the absolute source path)
# line up.
# -----------------------------------------------------------------------------
FROM base AS build-warmup-gcc
# Cap at 4 GB. CI runs read AND write back to /opt/buildcache-gcc, so the cap
# must comfortably exceed (baked entries + per-run accumulation) or LRU
# eviction starts dropping baked entries between nightly rebuilds.
ENV BUILDCACHE_ACCURACY=SLOPPY \
BUILDCACHE_MAX_CACHE_SIZE=4294967296
COPY --from=vcpkg-builder-gcc /opt/vcpkg-cache-gcc /opt/vcpkg-cache-gcc
COPY . /src
# Unity build is OFF here and in the consumer workflow: with unity ON, a
# single .cpp change invalidates the whole unity blob's cache entry, defeating
# the point. The flag must match between this stage and CI or hit rate
# collapses (the command line is part of the buildcache hash).
#
# RESINSIGHT_TREAT_WARNINGS_AS_ERRORS matches the cache workflow's setting so
# the warmup catches the same warnings CI would.
RUN --mount=type=cache,id=ri-ubuntu24-buildcache-gcc,target=/var/cache/buildcache,sharing=locked \
git config --global --add safe.directory '*' \
&& ( cd /src/ThirdParty/vcpkg && ./bootstrap-vcpkg.sh ) \
&& export CC=gcc-14 CXX=g++-14 \
&& export VCPKG_FEATURE_FLAGS=binarycaching \
&& export VCPKG_BINARY_SOURCES="clear;files,/opt/vcpkg-cache-gcc,read" \
&& export BUILDCACHE_DIR=/var/cache/buildcache \
&& cmake -S /src -B /src/cmakebuild -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DRESINSIGHT_INCLUDE_APPLICATION_UNIT_TESTS=true \
-DRESINSIGHT_TREAT_WARNINGS_AS_ERRORS=true \
-DRESINSIGHT_ENABLE_PRECOMPILED_HEADERS=false \
-DRESINSIGHT_ENABLE_UNITY_BUILD=false \
-DRESINSIGHT_ENABLE_HDF5=false \
-DRESINSIGHT_ENABLE_GRPC=true \
-DRESINSIGHT_GRPC_PYTHON_EXECUTABLE=$(command -v python3) \
-DRESINSIGHT_GRPC_DOWNLOAD_PYTHON_MODULE=true \
-DCMAKE_TOOLCHAIN_FILE=ThirdParty/vcpkg/scripts/buildsystems/vcpkg.cmake \
&& cmake --build /src/cmakebuild -- -j"$(nproc)" \
&& buildcache -s \
&& mkdir -p /opt/buildcache-gcc \
&& cp -a /var/cache/buildcache/. /opt/buildcache-gcc/ \
&& test -n "$(ls -A /opt/buildcache-gcc)" \
&& rm -rf /src
# -----------------------------------------------------------------------------
# Stage 5: warm the ResInsight buildcache for clang-19.
# -----------------------------------------------------------------------------
FROM base AS build-warmup-clang
ENV BUILDCACHE_ACCURACY=SLOPPY \
BUILDCACHE_MAX_CACHE_SIZE=4294967296
COPY --from=vcpkg-builder-clang /opt/vcpkg-cache-clang /opt/vcpkg-cache-clang
COPY . /src
RUN --mount=type=cache,id=ri-ubuntu24-buildcache-clang,target=/var/cache/buildcache,sharing=locked \
git config --global --add safe.directory '*' \
&& ( cd /src/ThirdParty/vcpkg && ./bootstrap-vcpkg.sh ) \
&& export CC=clang-19 CXX=clang++-19 \
&& export VCPKG_FEATURE_FLAGS=binarycaching \
&& export VCPKG_BINARY_SOURCES="clear;files,/opt/vcpkg-cache-clang,read" \
&& export BUILDCACHE_DIR=/var/cache/buildcache \
&& cmake -S /src -B /src/cmakebuild -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DRESINSIGHT_INCLUDE_APPLICATION_UNIT_TESTS=true \
-DRESINSIGHT_TREAT_WARNINGS_AS_ERRORS=true \
-DRESINSIGHT_ENABLE_PRECOMPILED_HEADERS=false \
-DRESINSIGHT_ENABLE_UNITY_BUILD=false \
-DRESINSIGHT_ENABLE_HDF5=false \
-DRESINSIGHT_ENABLE_GRPC=true \
-DRESINSIGHT_GRPC_PYTHON_EXECUTABLE=$(command -v python3) \
-DRESINSIGHT_GRPC_DOWNLOAD_PYTHON_MODULE=true \
-DCMAKE_TOOLCHAIN_FILE=ThirdParty/vcpkg/scripts/buildsystems/vcpkg.cmake \
&& cmake --build /src/cmakebuild -- -j"$(nproc)" \
&& buildcache -s \
&& mkdir -p /opt/buildcache-clang \
&& cp -a /var/cache/buildcache/. /opt/buildcache-clang/ \
&& test -n "$(ls -A /opt/buildcache-clang)" \
&& rm -rf /src
# -----------------------------------------------------------------------------
# Stage 6: final image -- base + both vcpkg caches + both warm buildcaches.
# -----------------------------------------------------------------------------
FROM base
LABEL org.opencontainers.image.source="https://github.com/OPM/ResInsight"
LABEL org.opencontainers.image.description="Ubuntu 24.04 CI image for ResInsight with gcc-14 + clang-19 toolchains, vcpkg binary caches, and warm ResInsight buildcaches"
COPY --from=vcpkg-builder-gcc /opt/vcpkg-cache-gcc /opt/vcpkg-cache-gcc
COPY --from=vcpkg-builder-clang /opt/vcpkg-cache-clang /opt/vcpkg-cache-clang
COPY --from=build-warmup-gcc /opt/buildcache-gcc /opt/buildcache-gcc
COPY --from=build-warmup-clang /opt/buildcache-clang /opt/buildcache-clang
# Default ENV targets the gcc-14 leg (the more common consumer: cache
# workflow's gcc matrix entry, plus the Copilot Coding Agent's setup-steps).
# Consumer workflows that target clang override BUILDCACHE_DIR and
# VCPKG_DEFAULT_BINARY_CACHE at the job level.
ENV BUILDCACHE_DIR=/opt/buildcache-gcc \
BUILDCACHE_ACCURACY=SLOPPY \
BUILDCACHE_MAX_CACHE_SIZE=4294967296 \
VCPKG_DEFAULT_BINARY_CACHE=/opt/vcpkg-cache-gcc
+18 -160
View File
@@ -1,35 +1,13 @@
# ResInsight CI Docker Images
# RHEL8 CI Docker Image
This directory contains the Dockerfiles for the prebuilt CI images used by the
Linux CI workflows. Each image bakes in everything that does not change on a
per-PR basis so CI runs only have to recompile the translation units that
This directory contains the Dockerfile for the prebuilt CI image used by the
RHEL8 unit test workflow. The image bakes in everything that does not change
on a per-PR basis so CI runs only have to recompile the translation units that
actually changed.
| Dockerfile | Image (per repo) | Consumer workflows |
| -------------------- | ----------------------------------------------- | ------------------------------------------------------------- |
| `Dockerfile.rhel8` | `ghcr.io/<repo>/ci-rhel8` | `rhel8-unit-tests.yml` |
| `Dockerfile.ubuntu24`| `ghcr.io/<repo>/ci-ubuntu24` | `ResInsightWithCacheLinuxContainer.yml`, `copilot-setup-steps.yml` |
## What's in the image
Both images follow the same multi-stage pattern:
1. A `base` stage with the toolchain(s), Qt, and `buildcache`.
2. One or more `vcpkg-builder` stages that populate per-compiler vcpkg binary
caches.
3. One or more `build-warmup` stages that perform a full ResInsight compile
at `/src -> /src/cmakebuild` and stash the resulting buildcache.
4. A `final` stage that assembles the toolchain plus the baked caches.
Each image is rebuilt nightly and pushed to GitHub Container Registry. The
image path is computed per repo as `ghcr.io/${GITHUB_REPOSITORY,,}/<name>` so
forks publish to their own namespaces.
---
## RHEL8 image (`Dockerfile.rhel8`)
### What's in the image
Built from `rockylinux:8` in four stages:
Built from `rockylinux:8` in four stages (see `Dockerfile.rhel8`):
- **Toolchain** — `gcc-toolset-14`, a from-source `libstdc++exp` matched to the
toolset's GCC, Qt 6.6.3 (via `aqtinstall`), Python 3.9, Ninja, CMake.
@@ -46,7 +24,11 @@ Built from `rockylinux:8` in four stages:
clones into the same `/src` path so buildcache hashes line up; mismatched
source paths or build flags collapse the hit rate.
### Where the image lives
## Where the images live
The image is published to GitHub Container Registry under the repository
namespace, computed by the workflows as
`ghcr.io/${GITHUB_REPOSITORY,,}/ci-rhel8`. In practice:
| Context | Image path |
| -------------------------------------- | --------------------------------------------------- |
@@ -55,7 +37,7 @@ Built from `rockylinux:8` in four stages:
Each push tags both `:latest` and a date tag `:YYYY-MM-DD`.
### Viewing the image
### Viewing the images
- **Web UI** — package page on GitHub:
`https://github.com/<owner>/ResInsight/pkgs/container/resinsight%2Fci-rhel8`
@@ -70,9 +52,9 @@ Each push tags both `:latest` and a date tag `:YYYY-MM-DD`.
(Use `/orgs/<org>/packages/...` instead of `/users/<owner>/...` for org-owned
packages like the upstream `OPM` namespace.)
### Building the image
## Building the image
#### Via GitHub Actions (the supported path)
### Via GitHub Actions (the supported path)
The image is built and pushed by `.github/workflows/build-rhel8-image.yml`:
@@ -98,7 +80,7 @@ Cold first build runs the full `ResInsight-tests` compile in the warmup stage
(~1.5–2 h). Incremental nightly rebuilds reuse the BuildKit `gha` cache and
finish much faster.
#### Building locally
### Building locally
Useful for validating Dockerfile changes before pushing to CI. From the repo
root:
@@ -127,7 +109,7 @@ Notes:
docker buildx build ... 2>&1 | tee ri-rhel8-build.log
```
#### Pushing a local image to GHCR
### Pushing a local image to GHCR
Useful when iterating on Dockerfile changes on a fork before merging: push to
your own GHCR namespace and trigger `rhel8-unit-tests.yml` on the fork to
@@ -154,7 +136,7 @@ verify end-to-end.
docker push ghcr.io/<owner>/resinsight/ci-rhel8:$(date -u +%Y-%m-%d)
```
### How the image is consumed
## How the image is consumed
`.github/workflows/rhel8-unit-tests.yml` runs the unit tests inside this
image. It resolves the image name from `${GITHUB_REPOSITORY,,}` so the same
@@ -168,7 +150,7 @@ Unity build is disabled in both the warmup and the CI configure for the same
reason: with unity on, a single `.cpp` change invalidates the entire unity
blob's cache entry.
### Retention
## Retention
`.github/workflows/cleanup-rhel8-image.yml` runs daily at 03:00 UTC and
deletes old dated tags from GHCR:
@@ -188,127 +170,3 @@ gh workflow run cleanup-rhel8-image.yml --repo <owner>/ResInsight \
Owner type (User vs Organization) is auto-detected so the workflow runs
unchanged on the upstream repo and on forks.
---
## Ubuntu 24.04 image (`Dockerfile.ubuntu24`)
### What's in the image
Built from `ubuntu:24.04` in six stages:
- **Toolchain** — both compilers used by the Linux legs of the cache workflow:
`gcc-14` from Ubuntu's repos and `clang-19` from the upstream LLVM apt repo
(`apt.llvm.org/noble/llvm-toolchain-noble-19`). Plus Python 3.12, Ninja,
CMake, and the GL / Qt apt deps used by the existing non-containerized legs.
- **Qt 6.7.0** at `/opt/Qt/6.7.0/gcc_64`, installed via `aqtinstall` with the
`qtnetworkauth` module. Same version as the cache workflow's Linux legs.
- **buildcache** — `v0.33.0` linux-amd64 binary release from the canonical
GitLab repo (`bits-n-bites/buildcache`). The RHEL8 image builds from source
because Rocky 8's glibc 2.28 is too old for the precompiled binary; Ubuntu
24.04 ships glibc 2.39 so the binary loads directly. On PATH, so
`CMakeLists.txt` auto-wires it as `CMAKE_CXX_COMPILER_LAUNCHER`.
- **vcpkg binary caches** — two of them, populated by independent stages that
run in parallel under BuildKit:
- `/opt/vcpkg-cache-gcc` (built with `gcc-14`)
- `/opt/vcpkg-cache-clang` (built with `clang-19`)
- **Warm ResInsight buildcaches** — two of them, each populated by a full
ResInsight compile (default target — wider than `ResInsight-tests` alone)
at `/src -> /src/cmakebuild`:
- `/opt/buildcache-gcc` (gcc-14, GRPC on)
- `/opt/buildcache-clang` (clang-19, GRPC on)
The final stage's ENV targets the gcc-14 leg (`BUILDCACHE_DIR=/opt/buildcache-gcc`,
`VCPKG_DEFAULT_BINARY_CACHE=/opt/vcpkg-cache-gcc`) so the Copilot Coding Agent's
`copilot-setup-steps.yml` works without overrides. The clang consumer overrides
both env vars at the job level.
### Where the image lives
| Context | Image path |
| -------------------------------------- | --------------------------------------------------- |
| Upstream (`OPM/ResInsight`) | `ghcr.io/opm/resinsight/ci-ubuntu24` |
| Fork (e.g. `magnesj/ResInsight`) | `ghcr.io/magnesj/resinsight/ci-ubuntu24` |
Each push tags both `:latest` and a date tag `:YYYY-MM-DD`.
### Viewing the image
- **Web UI**: `https://github.com/<owner>/ResInsight/pkgs/container/resinsight%2Fci-ubuntu24`
- **CLI**: same `gh api` recipe as the RHEL8 image above, with
`ci-ubuntu24` in place of `ci-rhel8`.
### Building the image
#### Via GitHub Actions
`.github/workflows/build-ubuntu24-image.yml`:
- **Nightly** at 00:00 UTC (the containerized cache workflow runs at 01:00
UTC).
- **On push** to any of: `Dockerfile.ubuntu24`, `build-ubuntu24-image.yml`,
`vcpkg.json`, `vcpkg-configuration.json`, `.gitmodules`. (Note the default
`vcpkg-configuration.json`, not the RHEL8 variant.)
- **Manually** via `workflow_dispatch`, optionally with `force_rebuild=true`
to skip the "today's image already exists" guard:
```
gh workflow run build-ubuntu24-image.yml --repo <owner>/ResInsight --ref <branch> \
-f force_rebuild=true
```
Cold first build runs the full ResInsight compile **twice** (once per
compiler) — ~3–4 h end-to-end. The job timeout is 360 min. Incremental
nightly rebuilds reuse the BuildKit `gha` cache and the per-compiler
`ri-ubuntu24-buildcache-{gcc,clang}` cache mounts, and finish much faster.
#### Building locally
```
docker buildx build \
--progress=plain \
--file .github/docker/Dockerfile.ubuntu24 \
--tag resinsight-ci-ubuntu24:local \
.
```
Notes:
- BuildKit required (same as the RHEL8 image).
- Cold local build is ~3–4 h on a typical workstation; the resulting image is
~6–7 GB (two toolchains, two warm caches).
- BuildKit runs the gcc and clang `vcpkg-builder` and `build-warmup` stages in
parallel where it can, so wall-clock time is less than 2× the per-compiler
cost.
#### Pushing a local image to GHCR
Same procedure as the RHEL8 image above, with `ci-ubuntu24` in place of
`ci-rhel8`.
### How the image is consumed
Two workflows use the image:
- **`.github/workflows/ResInsightWithCacheLinuxContainer.yml`** — parallel
companion to `ResInsightWithCache.yml`'s Linux legs. Runs both compilers in
a matrix, each leg overriding `BUILDCACHE_DIR` and `VCPKG_BINARY_SOURCES`
to its compiler's baked cache. Source is cloned manually into `/src`
(matching the warmup path) and `defaults.run.working-directory` is set to
`/src` so every step runs there.
- **`.github/workflows/copilot-setup-steps.yml`** — the GitHub Copilot Coding
Agent's pre-flight setup. Uses the image's gcc-14 default ENV; the agent's
first incremental build only recompiles what it edits because the warm
buildcache is already populated.
In both cases, unity build is OFF (matches the warmup) and the absolute source
path is `/src` (matches the warmup) — drift on either collapses the cache hit
rate.
### Retention
`.github/workflows/cleanup-ubuntu24-image.yml` runs daily at 03:00 UTC with
the same rules as the RHEL8 cleanup: keep `:latest`, keep the 3 most recent
versions as a safety floor, delete anything older than 5 days. The
`workflow_dispatch` `dry_run` and `retention_days` inputs are exposed the
same way.