Skip to content

/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

CodeMeaningTypical cause
0successthe main process finished normally
1application errorthe program exited with an error; read docker logs
125the docker run command itself failedunknown flag, invalid option, image problem before start
126command cannot be invokedthe CMD/ENTRYPOINT file is not executable
127command not foundwrong path or binary missing from the image (e.g. bash in an Alpine image)
130SIGINT (128 + 2)Ctrl-C in an attached container
137SIGKILL (128 + 9)docker kill, docker stop after the timeout, or the OOM killer
139SIGSEGV (128 + 11)segmentation fault in native code
143SIGTERM (128 + 15)docker stop handled by a process that exits on SIGTERM

Find out what happened

bash
docker ps -a --filter status=exited                          # exit codes of stopped containers
docker inspect -f '{{.State.ExitCode}} {{.State.OOMKilled}}' NAME
docker logs --tail 50 NAME

OOMKilled 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