ci(images): install docker-buildx so --mount=type=cache works (DEV-617)
Some checks failed
validate / JSON Schema (ajv) (push) Successful in 18s
validate / Rego (opa fmt + opa test) (push) Successful in 15s
build-images / signing-service image (push) Failing after 1m32s
validate / DB (migrate up/down dry-run) (push) Successful in 24s
validate / Go (vet + test) (push) Successful in 1m34s

The signing-service Dockerfile uses the BuildKit `--mount=type=cache`
syntax, which the legacy Docker builder rejects. Debian trixie's
`docker-cli` package does not pull in a BuildKit builder, so even
`DOCKER_BUILDKIT=1` fails with "the --mount option requires BuildKit".

Install Debian trixie's `docker-buildx` package (registers the plugin
at /usr/libexec/docker/cli-plugins/docker-buildx) and switch the build
step to an explicit `docker buildx build --load` so BuildKit frontend
features work regardless of docker-cli aliasing. `--load` ensures the
result is in the local daemon for the subsequent `docker push`.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
CTO (Paperclip) 2026-10-25 20:10:56 +00:00
parent 174a74435a
commit 770e71daab

View file

@ -22,9 +22,11 @@ jobs:
REGISTRY: harbor.basicstack.de REGISTRY: harbor.basicstack.de
IMAGE_REPO: harbor.basicstack.de/basicstack/signing-service IMAGE_REPO: harbor.basicstack.de/basicstack/signing-service
# The signing-service Dockerfile uses `RUN --mount=type=cache` which # The signing-service Dockerfile uses `RUN --mount=type=cache` which
# the legacy Docker builder rejects; enable BuildKit so the daemon # the legacy Docker builder rejects; the Debian `docker-buildx`
# routes the build through the Dockerfile frontend declared by # package registers the buildx CLI plugin at
# `# syntax=docker/dockerfile:1.7`. # `/usr/libexec/docker/cli-plugins/docker-buildx`, and setting
# `DOCKER_BUILDKIT=1` routes `docker build` through BuildKit so the
# `# syntax=docker/dockerfile:1.7` frontend handles `--mount`.
DOCKER_BUILDKIT: "1" DOCKER_BUILDKIT: "1"
steps: steps:
- name: Install git + buildx client + ca-certs - name: Install git + buildx client + ca-certs
@ -33,12 +35,15 @@ jobs:
apt-get update apt-get update
# Debian trixie: `docker.io` only installs the daemon; the CLI # Debian trixie: `docker.io` only installs the daemon; the CLI
# (`/usr/bin/docker`) ships in `docker-cli`, which is a Recommends # (`/usr/bin/docker`) ships in `docker-cli`, which is a Recommends
# and therefore excluded by `--no-install-recommends`. Add it # and therefore excluded by `--no-install-recommends`. The
# explicitly. # buildx plugin ships separately in `docker-buildx` and is
# required because the signing-service Dockerfile uses
# `RUN --mount=type=cache` (BuildKit-only syntax).
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
git curl ca-certificates docker.io docker-cli git curl ca-certificates docker.io docker-cli docker-buildx
git --version git --version
docker --version docker --version
docker buildx version
- name: Clone repository (sha256-aware) - name: Clone repository (sha256-aware)
run: | run: |
@ -63,7 +68,13 @@ jobs:
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
run: | run: |
set -euo pipefail set -euo pipefail
docker build \ # Explicit `docker buildx build` so BuildKit frontend features
# (`# syntax=`, `--mount=type=cache`) work on any docker-cli
# version regardless of whether `docker build` is aliased to
# buildx. The default `docker` driver loads the result into the
# local daemon, so the subsequent `docker push` finds the tags.
docker buildx build \
--load \
-f services/signing-service/Dockerfile \ -f services/signing-service/Dockerfile \
-t "${{ steps.tags.outputs.image_sha }}" \ -t "${{ steps.tags.outputs.image_sha }}" \
-t "${{ steps.tags.outputs.image_main }}" \ -t "${{ steps.tags.outputs.image_main }}" \