Docker Container Crash

Diagnose containers that crash or restart.

A Docker container that crashes or restarts in a loop is frustrating to debug. The container disappears before you can see what's happening. Here's how to investigate.

Symptoms

Common Causes

Diagnostic Steps

  1. Check logs with docker logs [container]
  2. Inspect state with docker inspect [container]
  3. Examine the exit code
  4. Run in interactive mode to debug

Automate with MoniTao

MoniTao detects when your containers aren't working:

Best Practices

FAQ

What does exit code 137 mean?

The container was killed by OOM Killer (out of memory).

Exit code 1 vs exit code 0?

0 = success, 1 = general error, 137 = OOM, 143 = SIGTERM.

How to debug without the container disappearing?

Change CMD to sleep infinity and exec into it.

Does MoniTao monitor Docker directly?

No, but it monitors services exposed by your containers.

Ready to Sleep Soundly?

Start free, no credit card required.