ProjectStack
docker

Container exited with code 137

Exit code 137 means the container process was killed with SIGKILL (signal 9). This is almost always caused by the Linux Out-of-Memory (OOM) killer terminating the container because it exceeded its memory limit, or by docker stop / docker kill being called.

Common causes

  • The container exceeded its memory limit and the kernel OOM killer terminated it
  • docker stop was called — this sends SIGTERM then SIGKILL after the timeout
  • Docker's --memory flag set the limit too low for what the application needs
  • A memory leak in the application caused it to grow until the kernel killed it

How to fix it

  1. Check if OOM killed it: docker inspect CONTAINER_ID | grep OOMKilled — if true, you need more memory
  2. Increase the memory limit: docker run --memory=2g myimage, or adjust in docker-compose.yml
  3. Check container resource usage: docker stats to see live memory consumption
  4. Profile the application for memory leaks if the process is growing unboundedly

Example

$ docker run --memory=256m myapp [...app output...] $ docker inspect myapp_1 | grep OOMKilled "OOMKilled": true

Container hit the 256MB memory limit and was killed by the OOM killer

Browse more errors

The Developer Hub covers 150+ errors across Git, npm, Node.js, Python, TypeScript, and Docker — with plain-English explanations and fix steps.