Skip to content

fix: native matrix + merge-manifests Docker build (replaces QEMU) - #22

Merged
reloadfast merged 1 commit into
mainfrom
fix/docker-native-multiarch
Feb 27, 2026
Merged

reloadfast merged 1 commit into
mainfrom
fix/docker-native-multiarch

Conversation

@reloadfast

Copy link
Copy Markdown
Owner

Problem

The existing docker.yml built both linux/amd64 and linux/arm64 in a single job using QEMU emulation. QEMU arm64 emulation on a Node+Python multi-stage image takes 30+ minutes on free GitHub runners, making the build effectively unusable.

Solution

Replace with the matrix + merge-manifests pattern:

  1. build job (matrix) — two runners in parallel:

    • linux/amd64 on ubuntu-latest
    • linux/arm64 on ubuntu-24.04-arm (GitHub's native ARM runner)
      Each runner builds its arch natively, pushes a digest-only image, and uploads the digest as an artifact.
  2. merge job — waits for both builds, downloads the digest artifacts, then calls docker buildx imagetools create to assemble a single multi-arch manifest with all final tags (:latest, :<sha>, semver).

Other changes

  • continue-on-error: true added to the Docker Hub description step — a token scope issue on the previous main-branch push caused that step to fail even though the image built successfully.
  • Per-arch GHA layer cache (scope=linux/amd64 / scope=linux/arm64) so the caches don't overwrite each other.
  • packages: write permission removed (was kept speculatively for GHCR, not needed for Docker Hub).

Expected outcome

  • arm64 build time: ~3–4 min (down from ~30+ min)
  • Resulting talesofthemoon/networkcrawler:latest manifest covers both architectures

Build amd64 on ubuntu-latest and arm64 on ubuntu-24.04-arm in parallel,
each pushing a per-arch digest. A final merge job assembles them into a
single multi-arch manifest using docker buildx imagetools create.

This reduces arm64 build time from ~30 min (QEMU emulation) to ~3-4 min
(native runner). Also adds continue-on-error to the Hub description step
to prevent a token scope issue from failing an otherwise successful build.
@reloadfast
reloadfast merged commit 9eb5a27 into main Feb 27, 2026
5 checks passed
@reloadfast
reloadfast deleted the fix/docker-native-multiarch branch February 27, 2026 19:45
reloadfast added a commit that referenced this pull request Feb 27, 2026
Squash merge of #22 omitted this commit. Applying directly to main.

Setting push: true alongside outputs with push-by-digest=true caused the
action to attempt a tagged push with no tag, triggering insufficient_scope
on Docker Hub. name=target was a literal placeholder; replaced with the
actual image name via format().
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.

1 participant