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

Restart policy `unless-stopped` container comes back after `docker stop` + daemon restart.

IntermediateTroubleshootingResources, health checks, logging and restarts
Answer

Likely causes → It was stopped by something other than an explicit docker stop (e.g. Compose down, kill), or always was used (restarts regardless on daemon start).

Diagnose → docker inspect -f '{{.HostConfig.RestartPolicy.Name}}' c.

Fix → Use unless-stopped or no and stop via docker stop.

Prevent → Know the semantic difference between always and unless-stopped.

All Docker questions Roadmap: Docker & containers

More on Resources, health checks, logging and restarts