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.
More on Resources, health checks, logging and restarts
Container restarts repeatedly: `docker ps` shows `Restarting (1) 5 seconds ago`.Beginner`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`.Intermediate