Skip to content

ci(docker): build and publish the ui image for amd64 and arm64 - #431

Merged
pashidlos merged 6 commits into
masterfrom
ci/351-multiarch-images
Oct 24, 2026
Merged

pashidlos merged 6 commits into
masterfrom
ci/351-multiarch-images

Conversation

@pashidlos

Copy link
Copy Markdown
Member

Problem

visualregressiontracker/ui is published for linux/amd64 only (every tag on Docker Hub, including 5.6.0 from today, has a single amd64 manifest), so on Apple Silicon and other arm64 hosts docker compose runs it under emulation (#351).

Root cause

No workflow builds or publishes the image. It is built by hand for amd64 only.

Fix

  • New .github/workflows/docker.yml: buildx + QEMU, platforms: linux/amd64,linux/arm64
    • pushing a vX.Y.Z tag (the existing release tag scheme) publishes visualregressiontracker/ui:X.Y.Z
    • workflow_dispatch with an existing tag republishes it. Run it with v5.6.0 to add arm64 to the current release
    • pull requests touching Dockerfile, env.sh, nginx/ or the workflow only build both platforms, without pushing (this PR triggers that build)
  • Dockerfile: the builder stage runs on $BUILDPLATFORM. Its output is static files, so npm ci and vite build run once natively instead of again under QEMU for arm64. Only the nginx stage is per platform.

Maintainer action needed: add the DOCKERHUB_USERNAME and DOCKERHUB_TOKEN repository secrets (a Docker Hub access token with write access to the visualregressiontracker org). Until then only the PR build runs.

Verification (arm64 macOS, Docker Desktop)

  • docker build --platform linux/amd64 and --platform linux/arm64 with the new Dockerfile: both build, and the image architectures are amd64 and arm64
  • ran both images: the containers report x86_64 and aarch64, serve the app and generate env-config.js from the environment
  • an arm64 ui image built from master ran in the main repo docker-compose.yml together with native arm64 api/migration images (UI 200, API healthy)

Unit tests, lint and build were not run: no application code changed.

Fixes Visual-Regression-Tracker/Visual-Regression-Tracker#351 (together with Visual-Regression-Tracker/backend#412 for the api and migration images)

🤖 Generated with Claude Code

Pavlo Strunkin and others added 3 commits October 24, 2026 10:41
The published ui image is linux/amd64 only, so on Apple Silicon and other
arm64 hosts it runs under emulation. Add a workflow that builds it with
buildx/QEMU for linux/amd64 and linux/arm64, publishes it on v* tags (or a
manual run for an existing tag) and only builds it on pull requests that
touch the image. The builder stage runs on the build platform, since its
output is static files.

Refs Visual-Regression-Tracker/Visual-Regression-Tracker#351

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- workflow_dispatch checks out refs/tags/<tag>, so a branch with the same
  name can't be published under a release version
- persist-credentials: false keeps GITHUB_TOKEN out of .git/config, which
  is part of the build context
- permissions: contents: read; pushes use the Docker Hub secrets

Addresses CodeRabbit review on backend#412.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@pashidlos
pashidlos merged commit df09f02 into master Oct 24, 2026
4 checks passed
@pashidlos
pashidlos deleted the ci/351-multiarch-images branch October 24, 2026 09:29
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.

The docker-compose file is not Apple M1 chip compatible

1 participant