Guides
How to build multi-platform images fast
Adding linux/arm64 makes the build take twenty minutes.
6 min read
Adding linux/arm64 makes the build take twenty minutes.
Why it happens
QEMU emulation runs the arm64 build on x64 hardware, which is 5–40× slower for anything that compiles.
How to fix it
- Build each architecture on a native runner of that architecture
- Push by digest from each leg, then merge with docker buildx imagetools create
- Keep a separate cache per architecture
- Only fall back to QEMU for images that do no compilation
Your next build could be twice as fast, at half the price
Start free. Migrating away is the same one line, and we publish that diff too.
Related
How to set up Docker layer cachingDocker builds take ten minutes because every layer rebuilds.How to optimise a Dockerfile for CISmall code changes trigger long rebuilds.How to use multi-stage Docker buildsImages are large and contain build tooling that should not ship.How to run concurrent Docker builds safelyParallel matrix legs contend and builds slow down or fail.