The image runs fine on your Mac. You push it, pull it on a cloud server, and the container exits immediately:
exec /app: exec format error
Enter fullscreen mode
Exit fullscreen mode
The image isn't corrupted. It was built for the wrong CPU. Apple Silicon Macs build linux/arm64 images by default, while most cloud servers are linux/amd64 (x86_64), and machine code for one can't run on the other. Everything below was tested on an amd64 Linux host with Docker Engine 29.9 and Buildx 0.38, without QEMU installed.
Reproducing it
Force the arm64 variant of an image on an amd64 host:
$ docker run --rm --platform linux/arm64 alpine:3.23 uname -m Unable to find image 'alpine:3.23' locally 3.23: Pulling from library/alpine Digest: sha256:85fe1e81d6758c208f3e1eed4338a1997e19d4be002d4dd32d3100c9a8c010a0 Status: Image is up to date for alpine:3.23 exec /bin/uname: exec format error
Enter fullscreen mode
Exit fullscreen mode
Docker happily downloads the arm64 version; the host CPU just can't execute it.…