How do you build and publish a multi-arch image (amd64 and arm64) efficiently?
IntermediateProductionGitHub Actions and GitLab CI in Production
Answer
Use docker buildx with --platform linux/amd64,linux/arm64. QEMU emulation works but can be 5–10x slower for compile-heavy images; faster is native builders: run the arm64 build on an ARM runner, push per-arch tags, then combine into a manifest list with docker buildx imagetools create.
docker buildx imagetools create -t ghcr.io/acme/api:1.7.0 \
ghcr.io/acme/api:1.7.0-amd64 ghcr.io/acme/api:1.7.0-arm64
More on GitHub Actions and GitLab CI in Production
How do you organise reusable workflows for an organisation on GitHub?IntermediateHow do you reduce GitHub Actions minutes cost on private repos?IntermediateHow do you secure self-hosted runners?AdvancedHow do you design the GitHub Actions OIDC trust policy for AWS safely?AdvancedHow do you handle approvals and deployments across environments in GitHub Actions?IntermediateHow do you handle required checks when workflows use path filters or matrices?Advanced