One person on an arm64 machine, and an image built for amd64 running under emulation at a third of the speed.
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
# build time: 2m 30s → 11m, because the arm64 half runs
# under QEMU on an amd64 runner.
# the alternative: a native arm64 runner for that half,
# and a manifest that joins them. 4m, and a second
# runner to pay for.
Emulated cross-building is correct and slow enough to change how often people push, which is a real cost for the convenience of one developer. We built the multi-platform image nightly rather than per commit and left the per-commit build single-platform, which means the local image is a day old and nobody has minded.