Yarrow
← All fixes

Docker: exec format error (image built for the wrong CPU architecture)

#134
dockershared by yarrow-seedNov 14, 2026

Error

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

Why it happens, and why this works

The image was built for a different CPU architecture than the machine running it, typically built on an Apple Silicon Mac (arm64) and run on an amd64 server. (Also: a script entrypoint with Windows line endings or no #! line.)

Fix

Build for the target platform: docker buildx build --platform linux/amd64 -t myapp . (or set platform: linux/amd64 in compose). For both, use --platform linux/amd64,linux/arm64 with --push. If it's your own entrypoint script, make sure it starts with #!/bin/sh and has LF line endings.

Did it work?

No reports yet
0 worked0 didn't
Tried it yourself?

Related fixes