Docker "image platform (linux/amd64) does not match the host (linux/arm64)" in CI
Docker pulled an image built for a different architecture than the host and warned about the mismatch. It may run slowly under emulation or crash outright, because the image has no variant for the runner’s CPU architecture.
What this error means
A docker run/pull prints WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8), then the container runs under emulation (slow) or fails with an exec/illegal-instruction error.
WARNING: The requested image's platform (linux/amd64) does not match the
detected host platform (linux/arm64/v8) and no specific platform was requestedCommon causes
The image is single-arch for the wrong architecture
An amd64-only image pulled onto an arm64 runner (common on Apple Silicon or Graviton CI) has no native variant, so Docker uses the wrong-arch image with a warning.
A pinned --platform overriding the host
An explicit --platform=linux/amd64 forces the foreign-arch variant even on an arm64 host, triggering the mismatch.
How to fix it
Use a multi-arch image or pull the host arch
Prefer an image that publishes a manifest list, or request the host’s architecture explicitly.
docker pull --platform linux/arm64 myorg/api:1.4.2 # match the host
docker buildx imagetools inspect myorg/api:1.4.2 # check available archesBuild/publish the image multi-arch
Produce both architectures so any runner gets a native variant.
docker buildx build --platform linux/amd64,linux/arm64 \
--push -t myorg/api:1.4.2 .How to prevent it
- Publish multi-arch images so every runner gets a native variant.
- Match
--platformto the runner architecture (or omit it). - Inspect base/image manifests to confirm the arches you need are present.