docker
architecture
ai_generated
true
exec /entrypoint.sh: exec format error
ID: docker/exec-format-error
93%Fix Rate
95%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 24 | active | — | — | — |
| 27 | active | — | — | — |
Root Cause
Binary architecture mismatch — running an amd64 image on arm64 or vice versa, or missing shebang in entrypoint script.
genericWorkarounds
-
93% success Build or pull the image for the correct platform: docker pull --platform linux/amd64
Explicitly specify the target platform
Sources: https://docs.docker.com/build/building/multi-platform/
-
90% success For script entrypoints, add #!/bin/sh shebang as the first line
Missing shebang causes exec format error on scripts
Dead Ends
Common approaches that don't work:
-
Re-pulling the same image tag
85% fail
Same architecture will be pulled again
-
Installing qemu-user without registering binfmt
65% fail
QEMU alone doesn't help; binfmt_misc must be registered
Error Chain
Frequently confused with: