`exec /entrypoint.sh: exec format error`
IntermediateTroubleshootingContainers that exit, crash or misbehave
Answer
Likely causes → Script lacks a shebang, or image architecture differs from host (arm64 image on amd64).
Diagnose →
docker image inspect image -f '{{.Os}}/{{.Architecture}}'
docker run --rm --entrypoint head image -1 /entrypoint.sh
Fix → Add #!/bin/sh, pull the right --platform, build multi-arch.
Prevent → Publish multi-arch manifests.
More on Containers that exit, crash or misbehave
Container exits immediately with code 0 right after `docker run -d`.Beginner`Exited (137)` with no OOM flag.Intermediate`Exited (139)` segmentation fault.Advanced`Exited (126)` / `Exited (127)`.Beginner`docker run` says `WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8)` and the app is very slow.BeginnerApp crashes with `Error: listen EADDRINUSE: address already in use :::3000` inside the container.Beginner