Refactor Linux CI to use pre-built Docker image from GHCR - #21972
Refactor Linux CI to use pre-built Docker image from GHCR#21972kadykov wants to merge 4 commits into
Conversation
- Remove .ci/Dockerfile (2016-era Jenkins artefact, superseded) - .devcontainer/devcontainer.json: switch to pre-built GHCR image - .github/workflows/build-docker.yml: implement build→test→push workflow that builds from .devcontainer/Dockerfile, runs all Linux CI matrix configurations via .github/scripts/test-image.sh, and only pushes to GHCR if every build succeeds - .github/workflows/ci.yml: Linux jobs pull ghcr.io/darktable-org/ darktable-build:latest; permissions scoped to contents:read only - .github/scripts/test-image.sh: new helper script that runs all four Linux CI matrix configurations (GNU16 Release, LLVM22 Release, GNU16 Debug, GNU16 Release+tests) against a candidate Docker image; also callable locally for manual validation - .devcontainer/README.md: update CI environment section to describe the build→test→push workflow and correct the GHCR image update cadence - .gitignore: add install/ (created by test-image.sh during local runs)
There was a problem hiding this comment.
Pull request overview
This PR refactors the Linux CI pipeline to run inside a pre-built Docker image published on GHCR (built from the devcontainer Dockerfile), removing per-run dependency installation and aligning CI + devcontainer on a single build-environment definition.
Changes:
- Add a dedicated build→test→push workflow to build and validate a candidate image before publishing to GHCR.
- Update Linux CI jobs to use
ghcr.io/darktable-org/darktable-build:latestand drop in-job package installation. - Switch the devcontainer configuration and docs to consume the published image; remove the legacy
.ci/Dockerfile; ignore locally-createdinstall/output.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/build-docker.yml |
Introduces a build/test/publish pipeline for the CI image. |
.github/scripts/test-image.sh |
Adds a helper script to run the Linux CI matrix against a candidate image. |
.github/workflows/ci.yml |
Moves Linux CI jobs to a GHCR-hosted container image and removes apt install steps. |
.devcontainer/devcontainer.json |
Switches devcontainer from local build to pulling the published image. |
.devcontainer/README.md |
Updates documentation to reflect the GHCR-based CI image workflow and usage. |
.ci/Dockerfile |
Removes an obsolete legacy Dockerfile. |
.gitignore |
Ignores install/ artifacts created by local image testing. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…docker-build workflow, authenticate in GHCR for pulling images in CI workflow
…patch Add a pull_request trigger on .devcontainer/Dockerfile changes so that a Dockerfile-modifying PR gets a full build-test cycle before merge. The "Tag and push" step is guarded by `github.event_name != 'pull_request'` so nothing is ever published to GHCR during a PR run.
Notes and caveats for reviewersA few things worth knowing before this lands: Splitting environment and code changesWith this approach, a PR that adds a new build dependency to the Dockerfile and code that uses it must be structured as two sequential PRs: first a Dockerfile-only PR (which, when merged, triggers Image freshness — no automatic base-image updates
Either approach is a small follow-up; I'm happy to add a What has been tested
|
|
I have some questions...
|
Follows up on #19597 (devcontainer configuration).
What this changes
Replaces the per-run
apt-get installsteps in the Linux CI jobs with a pre-built Docker image hosted on GHCR. The image is built from.devcontainer/Dockerfile, which was introduced in the prerequisite PR and already mirrors the CI environment exactly.Files changed
.github/workflows/build-docker.yml.github/scripts/test-image.sh, and pushes to GHCR only if every build succeeds.github/scripts/test-image.shdocker run+.ci/ci-script.sh. Also callable locally for manual image validation.github/workflows/ci.ymlghcr.io/darktable-org/darktable-build:latest; remove compiler and dependency install steps; permissions scoped tocontents: readonly.devcontainer/devcontainer.json"build":(local Dockerfile build) to"image":(pull pre-built image — faster for devcontainer users).devcontainer/README.md.ci/Dockerfile.devcontainer/Dockerfile.gitignoreinstall/(created bytest-image.shduring local runs)Why
Single source of truth
.devcontainer/Dockerfileis the only place that defines the Linux build environment.ci.ymland the devcontainer both consume it. No more risk of drift between them.Only tested images are published
The
build-docker.ymlworkflow implements a build→test→push sequence. It verifies every Linux CI matrix configuration against the candidate image before updating:latest. An image that cannot build darktable is never published.Faster CI feedback
The dependency install steps currently add several minutes to every Linux job. Pre-built images eliminate that overhead.
Easier contributor onboarding
devcontainer.jsonnow uses"image":so opening the devcontainer is adocker pullrather than a full local build.What does NOT change
nightly.yml— the AppImage build deliberately targetsubuntu-22.04for glibc compatibility and builds libs from source; it stays as-isCC/CXXenv varsImage update cadence
:latestis updated only when.devcontainer/Dockerfilechanges onmaster(triggeringbuild-docker.ymlautomatically) or when a maintainer triggers a manualworkflow_dispatch(e.g. to pick up upstream Ubuntu security patches). Between those events the image is frozen, which gives full control and reproducibility over the CI environment.Image tagging strategy
Images are pushed as:
ghcr.io/darktable-org/darktable-build:latest— rolling, used by CI and devcontainerghcr.io/darktable-org/darktable-build:YYYY-MM-DD-SHORTSHA— pinned, for auditingNotes
This PR replaces #21909 (same changes, cleaner git history — the earlier PR accumulated merge commits during development; please see that thread for full review context)
test-image.shcan also be used locally to validate a Dockerfile change before submitting a PR: