Docker "WARNING: The requested image's platform (linux/arm64) does not match" in CI
Docker is running an image built for a different architecture than the host. The warning that the requested platform (e.g. linux/arm64) does not match the detected host (linux/amd64) means the container runs under emulation - slowly, and sometimes with an exec format error if emulation is not set up.
What this error means
A docker run prints WARNING: The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64) and no specific platform was requested. The container may run slowly under QEMU, or fail with exec format error if binfmt/QEMU is missing.
WARNING: The requested image's platform (linux/arm64) does not match the
detected host platform (linux/amd64/v3) and no specific platform was requested
# container then runs under emulation, or fails: exec /app: exec format errorCommon causes
The image arch differs from the host arch
A tag that resolved to linux/arm64 on an amd64 runner triggers the warning; Docker falls back to emulation for the mismatched architecture.
No specific --platform requested
Without --platform, Docker picks an image variant that may not be the host arch, then warns and emulates.
Emulation not installed (turns warning into failure)
If QEMU/binfmt is not registered, the emulated run fails with exec format error instead of just running slowly.
How to fix it
Request the host platform explicitly
Pin --platform to the runner architecture so no emulation is used.
docker run --platform linux/amd64 ghcr.io/myorg/api:1.4.2Set up QEMU when you intend to emulate
Register binfmt/QEMU so cross-arch runs work (e.g. for arm64 testing on amd64).
- uses: docker/setup-qemu-action@v3
- run: docker run --platform linux/arm64 ghcr.io/myorg/api:1.4.2How to prevent it
- Pin
--platformto the runner architecture for production runs. - Install QEMU/binfmt when cross-arch emulation is intended.
- Pull multi-arch images so the host arch variant is selected.