Exit Code 137

Docker Runtime ErrorExit CodeCommonLast updated: June 28, 2026Tested on:Docker Engine v26.0Docker Compose v2.24June 2026

The containerized process was forcefully terminated by a SIGKILL (signal 9) signal from the host, typically due to memory exhaustion.

Exit Code 137 Quick Fix⏱️ Est. Fix Time: 3 minutes

Usually happens because:

  • Process consumed more memory than allocated
  • Container ignored SIGTERM and was force-stopped
  • Manual docker kill command executed

🔍 Quick Checklist:

What is Exit Code 137?

Exit code 137 is returned when the container process terminates due to receiving Unix signal 9 (SIGKILL). This is computed as 128 (offset for signal terminations) + 9 (SIGKILL). The most common causes are memory exhaustion (OOM), manual container termination via docker kill, or a docker stop command that exceeded its 10-second grace timeout.

Common Causes

  • Kernel Out of Memory (OOM) Killer: The host operating system terminated the container process because it ran out of memory.
  • Docker Stop timeout: The container process took too long to shutdown, forcing a SIGKILL from Docker.
  • Manual Docker Kill: A developer executed the 'docker kill' command to stop the container immediately.
CauseFrequency
Kernel Out of Memory (OOM) event⭐⭐⭐⭐⭐
Docker stop command timeout⭐⭐⭐⭐
Manual docker kill command⭐⭐

Common Mistakes

  • Assuming exit code 137 is always caused by OOM (it also occurs when a docker stop times out and force-kills the container).

How to Fix

1Allocate more memory resources: Increase container RAM limits using '-m' or compose configurations.
2Optimize application memory usage: Investigate memory leaks and optimize garbage collection parameters.
3Forward signals correctly: Ensure the container processes run under an init manager like 'tini' to forward SIGTERM.

Docker Operations & Verification

Inspect container exit code history.

Capture container exit code Example
docker ps -a --filter "exited=137"

Platform Specific Fixes

Scan kernel logs for OOM and SIGKILL signals.

Linux Config
sudo journalctl -k | grep -i -E 'oom|kill'

Best Practices

  • Verify container entrypoints propagate OS termination signals correctly to child processes.

Frequently Asked Questions (FAQ)

Q: What does exit code 137 mean?

It indicates that the container was stopped forcefully by a SIGKILL (signal 9) signal.

Q: How is this different from exit code 143?

Exit code 143 corresponds to SIGTERM (128 + 15), which represents a graceful shutdown request. Exit code 137 is a force kill (SIGKILL).

Q: How do I inspect why a container exited with 137?

Run 'docker inspect <container_id>' and check the 'OOMKilled' flag.

Q: How do I increase memory in compose?

Set limits: resources.limits.memory inside the deploy block.

Still having this problem?

Didn't solve your problem?

SuggestRequest Error