`Exited (126)` / `Exited (127)`.
BeginnerTroubleshootingContainers that exit, crash or misbehave
Answer
Likely causes → 126: command found but not executable; 127: command not found (or missing shebang interpreter).
Diagnose → docker run --rm --entrypoint sh image -c 'ls -l /app; which myapp'
Fix → chmod +x, correct the PATH/absolute path, install the missing binary, fix CRLF.
Prevent → Use exec form with absolute paths and add a smoke test.
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`exec /entrypoint.sh: exec format error`Intermediate`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