Process Flow - Restart policies
Start Container
Container Stops?
No→Keep Running
Yes
Check Restart Policy
no
→Do Not Restart
always
→Restart Container
on-failure
→Restart if Exit Code != 0
unless-stopped
→Restart unless Manually Stopped
Restart Container
Container Stops?
This flow shows how Docker checks if a container stops and then applies the chosen restart policy to decide whether to restart it.