/codes/docker/docker-exit-codes
Docker container exit codes: 125, 126, 127, 137, 139, 143
The commands on this page have not been executed by our verification runner yet.updated 2026-10-20
- tool
- Docker
- versions
- Docker Engine
- os
- linux
docker run exits with the exit code of the container's main process. Three codes come from Docker itself (125, 126, 127); codes above 128 mean the process was ended by a signal, where the code is 128 plus the signal number (137 = 128 + 9, SIGKILL).
Exit codes
| Code | Meaning | Typical cause |
|---|---|---|
| 0 | success | the main process finished normally |
| 1 | application error | the program exited with an error; read docker logs |
| 125 | the docker run command itself failed | unknown flag, invalid option, image problem before start |
| 126 | command cannot be invoked | the CMD/ENTRYPOINT file is not executable |
| 127 | command not found | wrong path or binary missing from the image (e.g. bash in an Alpine image) |
| 130 | SIGINT (128 + 2) | Ctrl-C in an attached container |
| 137 | SIGKILL (128 + 9) | docker kill, docker stop after the timeout, or the OOM killer |
| 139 | SIGSEGV (128 + 11) | segmentation fault in native code |
| 143 | SIGTERM (128 + 15) | docker stop handled by a process that exits on SIGTERM |
Find out what happened
docker ps -a --filter status=exited # exit codes of stopped containers
docker inspect -f '{{.State.ExitCode}} {{.State.OOMKilled}}' NAME
docker logs --tail 50 NAMEOOMKilled true with code 137 means the container hit its memory limit (--memory or a Kubernetes resources.limits.memory). Code 137 with OOMKilled false usually means it was killed by docker stop after the grace period (10 seconds by default) because the process ignored SIGTERM.
Sources
Related pages
codes · coreutilsLinux signals: numbers, names and default actionsLinux signal numbers on x86 and ARM: SIGHUP 1, SIGINT 2, SIGKILL 9, SIGTERM 15, SIGCHLD 17, SIGSTOP 19, with their default action and the exit code 128+n.codes · bashBash exit codes: 0, 1, 2, 126, 127, 128+n and 255What bash exit codes mean: 0 success, 1 general error, 2 misuse of builtins, 126 not executable, 127 not found, 128+n killed by signal n, and how to read $?.compare · dockerDockerfile CMD vs ENTRYPOINT: differences and when to use eachENTRYPOINT sets the executable a container always runs; CMD sets default arguments that docker run can replace. How they combine, and exec form vs shell form.