Docker · Containers in practice

How do you build images for multiple CPU architectures?

Hardmulti-platformbuildxarm64Updated Oct 2026
Quiz this track

Short answer

Use docker buildx with --platform and push a manifest list. Native builders are fast; QEMU emulation works but is slow and can fail on architecture-specific code.

A multi-platform build produces one tag backed by a manifest list that points to per-architecture images. The client pulls the variant matching its platform. Base images must also publish the target architecture.

sh
docker buildx create --name multi --driver docker-container --use
docker buildx build --platform linux/amd64,linux/arm64 \
  --push -t registry.example.com/api:1.0.0 .
docker buildx imagetools inspect registry.example.com/api:1.0.0
The push is required because a multi-platform result is a manifest list, not a local image.

Practical constraints

  • QEMU emulation is convenient but much slower and can expose timing or instruction issues
  • Native arm64 builders are the reliable path for heavy builds
  • Some dependencies need cross-compilation flags or a target-specific toolchain
  • CGO and native modules may need architecture-specific build stages
  • Base image tags must support every requested platform

Test the arm64 image on arm64 hardware before release. A successful cross-build does not prove the binary runs correctly, especially for code with assembly, JIT or native libraries.

Pulling a multi-platform tag on an unsupported architecture fails with a manifest mismatch. Check the platform list with imagetools before assuming a tag is universal.

Follow-ups you should expect

Interviewers use these to check whether the first answer was understanding or memorisation.

  1. 1What is a manifest list?
  2. 2Why is QEMU emulation slow?
  3. 3How do you handle a dependency that does not cross-compile?
  4. 4How do you verify the arm64 image actually works?

Say it in the interview

I use buildx with --platform and push a manifest list so clients pull the matching architecture. For heavy builds I prefer native builders, because QEMU emulation is slow and can hide architecture-specific failures. I also test the arm64 image on real arm64 hardware, since a successful cross-build does not prove the binary runs correctly.

Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.

Related questions

Reading is step one

Now say it out loud.

Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live Docker mock interview and get scored feedback on depth, clarity and confidence.