Skip to content

fix(image-builder): silence platform lint + sign container images#3186

Merged
vpetersson merged 4 commits into
masterfrom
worktree-goofy-drifting-wave
Jul 16, 2026
Merged

fix(image-builder): silence platform lint + sign container images#3186
vpetersson merged 4 commits into
masterfrom
worktree-goofy-drifting-wave

Conversation

@vpetersson

Copy link
Copy Markdown
Contributor

Issues Fixed

No associated issue. Fixes the two FromPlatformFlagConstDisallowed BuildKit lint warnings surfaced in the Docker Image Build CI job, and adds container image signing.

Description

Two independent supply-chain / build-hygiene changes:

  • Silence FromPlatformFlagConstDisallowed in the Qt 5 webview builder template. The sysroot stage drops its literal --platform (a bare FROM already defaults to the armhf target for pi2/pi3), and the host toolchain stage's mandatory linux/amd64 pin is routed through a global QT5_HOST_PLATFORM ARG declared in Dockerfile.viewer.j2 (so it stays in scope for the included stage's FROM --platform). Verified with docker build --check on a rendered pi2 Dockerfile: warnings gone, no ARG-scoping errors.
  • Attest build provenance for pushed images. The buildx job now resolves each pushed <short-hash>-<board> image digest and mints keyless Sigstore build-provenance attestations via GitHub OIDC — the same mechanism the SBOM workflow already uses. server/viewer/redis are attested on GHCR (hard-fail) and Docker Hub (best-effort, matching how publish-latest treats its Docker Hub mirror). Attestation is by digest, so the latest-<board> tags and both registries are covered; verify with gh attestation verify oci://... --repo Screenly/Anthias.

Checklist

  • I have performed a self-review of my own code.
  • New and existing unit tests pass locally and on CI with my changes.
  • I have done an end-to-end test for Raspberry Pi devices.
  • I have tested my changes for x86 devices.
  • I added a documentation for the changes I have made (when necessary).

Note

The attestation steps only run on master pushes (gated on github.event_name == 'push', like the existing image push), so they cannot be exercised from this PR branch — they take effect on the first post-merge build.

vpetersson and others added 2 commits July 13, 2026 15:16
- Drop the literal --platform on the Qt 5 sysroot stage; a bare FROM
  already defaults to the armhf target platform for pi2/pi3.
- Route the Qt 5 host stage's mandatory amd64 pin through a global
  QT5_HOST_PLATFORM ARG declared in Dockerfile.viewer.j2, so it stays
  in scope for the FROM --platform in the included builder template.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Resolve each pushed <short-hash>-<board> image digest and mint
  keyless Sigstore build-provenance attestations via GitHub OIDC
  (same mechanism the SBOM workflow uses).
- Attest server/viewer/redis on GHCR (hard-fail) and Docker Hub
  (best-effort, matching publish-latest's soft-fail mirror).
- Grant the buildx job id-token: write + attestations: write.

Attestations are by digest, so latest-<board> tags and both
registries are covered; verify with `gh attestation verify oci://...`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vpetersson
vpetersson requested a review from a team as a code owner July 13, 2026 15:39
@vpetersson vpetersson self-assigned this Jul 13, 2026
@vpetersson
vpetersson requested a review from Copilot July 13, 2026 15:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the container image build pipeline to (1) address BuildKit lint warnings in the Qt 5 viewer build templates and (2) add keyless Sigstore build-provenance attestations for pushed images as part of the CI build.

Changes:

  • Introduces a global QT5_HOST_PLATFORM ARG (scoped before the first FROM) to avoid literal --platform pins while keeping the Qt 5 host stage forced to amd64.
  • Removes the literal --platform=linux/arm/v7 from the Qt 5 sysroot stage to silence FromPlatformFlagConstDisallowed.
  • Extends the docker-build workflow to resolve pushed image digests and mint/push build-provenance attestations for server/viewer/redis images (GHCR hard-fail; Docker Hub best-effort).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
docker/Dockerfile.viewer.j2 Adds a pre-FROM global ARG to support Qt 5 host-stage platform pinning without triggering BuildKit lint.
docker/Dockerfile.qt5-webview-builder.j2 Removes constant --platform usage in the sysroot stage and routes the amd64 host pin through the new global ARG.
.github/workflows/docker-build.yaml Adds OIDC/attestation permissions and per-board digest resolution + provenance attestation steps for pushed images.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread docker/Dockerfile.qt5-webview-builder.j2
The header's stage layout described webview-builder as running on
$BUILDPLATFORM and installing Linaro's gcc-7.4.1 cross-compiler. Both
are stale: the stage is pinned to linux/amd64 via QT5_HOST_PLATFORM
(and the stage's own comment now explicitly warns that $BUILDPLATFORM
would break it on an Apple Silicon host), and Linaro's tarball was
dropped for Debian's crossbuild-essential-armhf when releases.linaro.org
retired — the Linaro-named path survives only as a symlink shim for the
frozen qmake.conf.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@vpetersson
vpetersson merged commit 2eb16be into master Jul 16, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants