Interview Prep/Docker/Containers that exit, crash or misbehave

`Exited (137)` with no OOM flag.

IntermediateTroubleshootingContainers that exit, crash or misbehave
Answer

Likely causes → SIGKILL: docker kill, a stop timeout expiry, host OOM killer (outside cgroup limit), or an orchestrator eviction.

Diagnose →

docker inspect -f '{{.State.OOMKilled}} {{.State.ExitCode}}' c
dmesg -T | grep -i -E 'killed process|oom'
docker events --since 1h --filter container=c

Fix → If host OOM, add memory or limits; if timeout, handle SIGTERM and raise --stop-timeout.

Prevent → Set memory limits so the kernel kills inside the cgroup, not randomly on the host.

All Docker questions Roadmap: Docker & containers

More on Containers that exit, crash or misbehave