CI: use pre-built Docker image for Linux build jobs - #21909
Conversation
Add a complete devcontainer environment for building and testing darktable, including Dockerfile with all dependencies, configuration, and documentation. Also update .gitignore to exclude AppDir for AppImage builds.
Co-authored-by: Philipp Lutz <810285+da-phil@users.noreply.github.com>
…e to Ubuntu 26.04 and installing matching packages. Enhance README with compiler details and CI alignment information.
…ncing compatibility details for various IDEs.
…ment for contributors in the main README
…ontainer-based build environment
…se pre-built image, and create GitHub Actions workflow for image build and publish
Action needed from a
|
There was a problem hiding this comment.
Pull request overview
This PR switches Linux GitHub Actions CI builds from installing dependencies on every run to using a pre-built Docker image published to GHCR, aligning CI and the devcontainer on a shared build environment definition.
Changes:
- Update Linux CI job to run inside
ghcr.io/darktable-org/darktable-build:latest, removing per-runapt-get installsteps. - Add image publishing/build steps (including a
publish-imagejob inci.ymland a manualbuild-docker.ymlworkflow). - Update the devcontainer configuration and documentation to pull and use the published image.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
.github/workflows/ci.yml |
Linux job now uses a GHCR image; adds a publish-image job to build/push updated images. |
.github/workflows/build-docker.yml |
Changes the image build workflow to be manual-only and adds tag computation + caching. |
.devcontainer/README.md |
Updates docs to describe the new CI/devcontainer image flow and GHCR usage. |
.devcontainer/devcontainer.json |
Switches devcontainer from building locally to consuming the published GHCR image. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| permissions: | ||
| contents: read | ||
| packages: write |
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| paths: | ||
| - '.devcontainer/Dockerfile' | ||
| # Manual trigger only — useful when the upstream ubuntu:26.04 base image | ||
| # updates without a Dockerfile change. Normal :latest updates happen via ci.yml. | ||
| workflow_dispatch: |
| To add or remove packages, edit `.devcontainer/Dockerfile` and submit it as a | ||
| normal PR. CI will build from the updated Dockerfile automatically, so you can | ||
| verify the environment works before the change is merged. |
|
|
||
| Linux: | ||
| if: github.repository == 'darktable-org/darktable' || github.event_name == 'workflow_dispatch' | ||
| name: Linux_${{ matrix.distro }}_${{ matrix.compiler.compiler }}_${{ matrix.btype }}${{ matrix.name_suffix }} |
There was a problem hiding this comment.
Instead of matrix.distro we could keep the flexibility to test against docker images which are based on different distros, e.g. Ubuntu 26.04, Fedora 44, OpenSUSE 16 etc. (potential future work if we want to follow-up with that).
| publish-image: | ||
| name: Publish CI Docker image | ||
| needs: Linux | ||
| if: (github.repository == 'darktable-org/darktable' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/master' |
There was a problem hiding this comment.
What does github.event_name == 'workflow_dispatch') mean?
I'm just trying to understand when this action is even triggered. Could possibly be triggered manually, right?
There was a problem hiding this comment.
Does this mean after .github/workflows/build-docker.yml finishes building the image?
I wonder why this action is part of the ci.yml file and not part of build-docker.yml as the final step after the docker image was built?
The step Compute image tags is also duplicated across both files.
There was a problem hiding this comment.
Since this review the architecture has changed significantly. The publish-image job has been removed from ci.yml entirely. build-docker.yml now owns all image publishing and implements a build → smoke-test → push sequence. workflow_dispatch on that workflow lets a maintainer force a manual rebuild (e.g. to pick up Ubuntu security patches without changing the Dockerfile). ci.yml has no publishing step at all — it simply pulls :latest.
There was a problem hiding this comment.
Merging in master brought back the deprecated dockerfile.
Also, I don't think that syncing feature branches against master is done via merge commits in the darktable repo, we usually rebase against master.
It's also not nice to have merge commits in a feature branch commit history, when it gets merged back to master via a merge commit.
|
@TurboGit I think #21909 (comment) was addressed to you
|
… script, move image publishing to build-docker workflow
|
@da-phil Thank you for the thorough review on this PR! I wanted to let you know that I've addressed all of the feedback, including the dirty git history, in a fresh PR #21972 A brief summary of what changed in response to the review: Dirty git history / merge commit /
|
|
@kadykov : the GHCR package is now set to public. |
Follows up on #19597 (devcontainer configuration).
What this changes
Replaces the per-run
apt-get installsteps in the Linux CI jobs with apre-built Docker image hosted on GHCR. The image is built from
.devcontainer/Dockerfile, which was introduced in the prerequisite PR andalready mirrors the CI environment exactly.
Files changed:
.github/workflows/build-docker.yml— new workflow: builds and pushes theimage to GHCR when
.devcontainer/Dockerfilechanges.github/workflows/ci.yml— Linux job: use GHCR image, remove compilerand dependency install steps
.devcontainer/devcontainer.json— switch from local build to pulling thepublished GHCR image (faster for devcontainer users)
.ci/Dockerfile— removed (2016-era Jenkins artefact, superseded)Why
the Linux build environment.
ci.ymland the devcontainer both consume it.No more risk of drift between them.
minutes to every Linux job. Pre-built images eliminate that overhead.
devcontainer.jsonnow uses"image":instead of"build":, so opening the devcontainer is adocker pullrather than afull image build.
What does NOT change
nightly.yml— the AppImage build deliberately targetsubuntu-22.04forglibc compatibility and builds libs from source; it stays as-is
unchanged; compiler choice continues to be
CC/CXXenv varsImage tagging strategy
Images are pushed as:
ghcr.io/darktable-org/darktable-build:latest— rolling, used by CIghcr.io/darktable-org/darktable-build:YYYY-MM-DD-SHORTSHA— pinned, forauditing
The build-docker workflow triggers on:
masterthat modifies.devcontainer/Dockerfileworkflow_dispatch