Docker · tool · fg-0263

Image built on an Apple Silicon Mac crashes with 'exec format error' on an amd64 server

exec /usr/local/bin/docker-entrypoint.sh: exec format error

Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100

Cause

docker build targets the build machine's architecture unless told otherwise, so an M-series Mac produces linux/arm64 images. The reverse happens when an image publishes only amd64 and you pull it on the Mac without a platform.

Fix

Set the target platform explicitly when building images for servers, and set platform in Compose for images that only ship amd64 so Desktop runs them under emulation.

Apply

docker buildx build --platform linux/amd64 -t "$IMAGE" --push .
# compose
services:
  app:
    platform: linux/amd64

Affects: Docker Desktop on Apple Silicon (M1 and later); Rosetta emulation on by default since Desktop 4.25 on macOS 14.1 and later

Sources

Have your agent know this before it fails

claude mcp add --transport http footgun https://getfootgun.com/api/mcp