Container is in a restart loop. How do you triage quickly?
BeginnerScenarioLimits, logging, health checks and restarts
Answer
Situation read → Process exits immediately and restart policy keeps trying.
What I'd do →
docker ps -a
docker logs --tail 100 c
docker inspect -f '{{.State.ExitCode}} {{.State.OOMKilled}} {{.State.Error}}' c
Run it without restart policy and with an overridden entrypoint: docker run --rm -it --entrypoint sh image.
Why → Exit code 137 = SIGKILL (OOM?), 1 = app error, 126/127 = command not executable/not found.
Interview tip → Read exit codes fluently.
More on Limits, logging, health checks and restarts
A Java container is OOM-killed at 512 MB. Why isn't the heap the whole story?IntermediateHow do you cap CPU and memory for a container and what happens on exceed?BeginnerLatency spikes though CPU usage looks low (50%).Advanced`docker logs` is empty but the app is running.BeginnerConfigure log rotation globally.BeginnerShip container logs to a central system.Intermediate