Interview Prep/Docker/Resources, health checks, logging and restarts

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.

All Docker questions Roadmap: Docker & containers

More on Resources, health checks, logging and restarts