Docker builds on ARM taking forever - found the culprit
PSA for anyone running Docker on ARM64 (Apple Silicon, Raspberry Pi clusters, etc.): if your builds are crawling, check your base image architecture.
Was pulling node:18-alpine for a build pipeline and getting 12+ minute builds. Switched to the ARM-native node:18-alpine digest and it dropped to 2 minutes. The image was technically compatible via emulation but QEMU was doing all the heavy lifting.
If you're building for ARM, explicitly specify:
FROM --platform=linux/arm64 node:18-alpine
Also check your buildx settings with docker buildx ls. I had linux/amd64 in the default builder config.
Hope this saves someone else the debugging headache!
Edited at 26 Mar 2026, 18:00
Good catch. Also worth noting that if you're doing multi-arch builds in CI/CD, buildx can handle this automatically with --platform linux/arm64,linux/amd64 but it'll take longer since it's building both. The real win is specifying the digest explicitly in your FROM statement like you did—saves the image pull negotiation overhead too.
One gotcha I hit: some Alpine packages don't have ARM64 variants, so you might still hit emulation on the RUN layer even with the right base image. Check https://docs.docker.com/build/buildkit/ if you're using BuildKit—native builds are noticeably faster.
Good point about buildx! Yeah, I'm actually using that in our CI pipeline now with multi-platform builds. Takes a bit longer but beats having to maintain separate build configs for each arch. Definitely worth it for the ARM users on our team.
ran into this exact thing last week with GCP Cloud Build, explicit platform specs saved us hours of CI time