Container restarts repeatedly: `docker ps` shows `Restarting (1) 5 seconds ago`.
BeginnerTroubleshootingResources, health checks, logging and restarts
Answer
Likely causes → App crashes on start (bad config, missing dependency, port conflict) with a restart policy re-launching it.
Diagnose →
docker logs --tail 100 c
docker inspect -f '{{.State.ExitCode}} {{.State.Error}} {{.RestartCount}}' c
Fix → Fix the startup error; temporarily docker update --restart no c to stop the loop while debugging.
Prevent → Use on-failure:N for jobs and alert on restart counts.
More on Resources, health checks, logging and restarts
`OOMKilled: true` and exit code 137.BeginnerContainer is `unhealthy` but the app works when tested manually.Intermediate`docker stats` shows 100%+ CPU and the container is slow.Intermediate`docker logs` is slow or `docker logs -f` hangs on a container with huge logs.Intermediate`Error response from daemon: configured logging driver does not support reading` when running `docker logs`.IntermediateApplication hangs and logs stop: log driver blocking (`fluentd: connection refused`).Advanced