Infrastructure
Docker Multi-Platform Images: Buildx and Manifest Lists
Build and verify amd64 and arm64 images without shipping the wrong architecture or hiding emulation-specific failures.
In this article
Docker Multi-Platform Images: Buildx and Manifest Lists
A multi-platform image tag points to an OCI image index or Docker manifest list. The index maps platform tuples such as linux/amd64 and linux/arm64 to architecture-specific manifests. A compatible runtime selects the right child automatically, provided the publisher built and tested every advertised variant.
The practical model
Treat docker multi-platform images: buildx and manifest lists as a system with four review points: pick a build strategy, make the dockerfile platform-aware, publish one coherent index, test where the image will run. Give each point an owner, a measurable acceptance condition, and a rollback trigger. Thresholds should come from observed workloads, contracts, or risk tolerance rather than an unexplained default.
Pick a build strategy
Emulation with QEMU is convenient for occasional builds but can be slow and can mask architecture behavior. Native builders offer the most faithful compilation and tests. Cross-compilation is fast for languages that support it, but any build step that executes target binaries still needs an appropriate runner.
Make the Dockerfile platform-aware
Use BUILDPLATFORM for build stages that run tools and TARGETOS/TARGETARCH for target artifacts. Pin base images by version and inspect whether each base actually publishes every required architecture. Avoid downloading a binary named “linux” without selecting its architecture and verifying a checksum.
Publish one coherent index
Buildx can push variants and assemble the index in one operation. Treat the index digest as the release identity and preserve per-platform digests for incident response. Inspect the published manifest, labels, SBOM and signatures rather than trusting a successful build log.
Test where the image will run
Execute smoke, integration, and startup tests on real amd64 and arm64 runners. Compare native dependencies, page size assumptions, floating-point behavior, and memory. Pull by tag on each platform after publication to verify registry selection, not only local cache behavior.
Common pitfalls
- Using uname from an emulated build step to choose artifacts.
- Publishing an index before all variants pass.
- Assuming Alpine and glibc dependencies behave identically.
- Signing only a local image rather than the published index and children.
A focused test plan
- Pick a build strategy: verify that emulation with QEMU is convenient for occasional builds but can be slow and can mask architecture behavior. Then introduce the failure case “using uname from an emulated build step to choose artifacts” and confirm that the system fails visibly, stays within its safety boundary, and has a documented recovery action.
- Make the Dockerfile platform-aware: verify that use BUILDPLATFORM for build stages that run tools and TARGETOS/TARGETARCH for target artifacts. Then introduce the failure case “publishing an index before all variants pass” and confirm that the system fails visibly, stays within its safety boundary, and has a documented recovery action.
- Publish one coherent index: verify that buildx can push variants and assemble the index in one operation. Then introduce the failure case “assuming alpine and glibc dependencies behave identically” and confirm that the system fails visibly, stays within its safety boundary, and has a documented recovery action.
- Test where the image will run: verify that execute smoke, integration, and startup tests on real amd64 and arm64 runners. Then introduce the failure case “signing only a local image rather than the published index and children” and confirm that the system fails visibly, stays within its safety boundary, and has a documented recovery action.
Primary references
Conclusion
Multi-platform publishing is a release matrix, not a checkbox. Make target selection explicit, verify the registry index, and run real tests on every architecture you promise.