docker architecture ai_generated true

exec /entrypoint.sh: exec format error

ID: docker/exec-format-error

Also available as: JSON · Markdown
93%Fix Rate
95%Confidence
50Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
24 active
27 active

Root Cause

Binary architecture mismatch — running an amd64 image on arm64 or vice versa, or missing shebang in entrypoint script.

generic

Workarounds

  1. 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/

  2. 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:

  1. Re-pulling the same image tag 85% fail

    Same architecture will be pulled again

  2. Installing qemu-user without registering binfmt 65% fail

    QEMU alone doesn't help; binfmt_misc must be registered

Error Chain

Frequently confused with: