Containers should start automatically after a host reboot, but not a one-off debug container.
BeginnerScenarioLimits, logging, health checks and restarts
Answer
Situation read → Restart policies plus the Docker service enabled.
What I'd do → systemctl enable docker, run services with --restart unless-stopped, debug containers with --rm and no policy. Check with docker inspect -f '{{.HostConfig.RestartPolicy.Name}}' c.
Why → Restart policy applies when the daemon starts.
Interview tip → live-restore keeps containers up during daemon restarts.
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