Repository navigation
Build arm64 images natively instead of emulating them - #70
Merged
Merged
Conversation
Emulating arm64 with QEMU on the amd64 runners took about 90 minutes per PHP version (amd64 itself: about 6), so a nightly run took up to 150 minutes. Every platform now builds on a native runner of its own (ubuntu-24.04 and ubuntu-24.04-arm), pushes by digest only, and a merge job combines the digests into one manifest list per PHP version and tags it in both registries. The PHP versions stay listed once, in the build matrix; the merge job takes them from the names of the digest artifacts. The registry cache is now kept per platform. Refs OPS-8R Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kdambekalns
marked this pull request as ready for review
November 4, 2026 19:18
kdambekalns
referenced
this pull request
Nov 4, 2026
The GitHub Actions cache evicts layer blobs while the cache index still references them. BuildKit then fails the build instead of treating this as a cache miss. Store the build cache in Harbor instead, using one cache reference per PHP minor version. A new patch release thus overwrites the cache of the previous one instead of leaving it behind in the registry.
baschny
reviewed
Nov 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The nightly build takes up to 150 minutes, almost all of it emulating arm64 with QEMU. Run of 2026-11-04, PHP 8.4: amd64 5.8 min, arm64 89 min.
This builds every platform natively on a runner of its own:
preparedetermines the latest release tag oncebuild: matrix PHP × platform,linux/amd64onubuntu-24.04,linux/arm64onubuntu-24.04-arm(free for public repositories). Each job pushes its image to both registries by digest only, so no tag points at a single-platform image at any time.mergecombines the two digests of every PHP version into one manifest list withdocker buildx imagetools createand tags it (8.4,8.4.27) in Docker Hub and Harbor. Each registry gets the list from its own blobs. It fails if a version does not have exactly two digests.announcedispatches to docker-beach-php and docker-composer as before, now aftermergeThe PHP versions are still listed once, in the build matrix;
mergereads them from the names of the digest artifacts. The registry cache is kept per platform (php-build-cache:8.4-amd64,…-arm64); the oldphp-build-cache:8.4entries can be deleted from Harbor once this runs.Tested:
actionlintis clean; the shell of the merge step was run locally against fake artifacts, including a missing platform.Test run (
workflow_dispatchon this branch, https://github.com/flownative/docker-php/actions/runs/41892094170): 10 min instead of ~150. Build jobs 5–9 min each, merge 1 min. All tags in Docker Hub and Harbor carry amd64 and arm64, the version label is correct, and the dispatched builds of docker-beach-php (8 min) and docker-composer (4 min) succeeded on top of the new images.Refs OPS-8R (https://minka.flownative.com/go/card/OPS-8R)