New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Restart unless stopped docker policy meaning?
in Help
docker run -d --name rancher \
--privileged \
--restart=unless-stopped \
-p 8888:443 \
rancher/rancher:v2.5.16
I understood the following restart policies but not unless-stopped.
no,on-failure,always they're intuitive to understand.
unless-stopped: Restarts the container unless you manually stop it.
This is confusing. Please explain thus.

Comments
I think AI can answer so good at this but I am too lazy to ask him for you, sorry.
That means if you manually issue "docker stop", then it will not restart.
But it will restart after pretty much everything else: reboot, unexpected failures etc.
It will restart the container even after a failure instead of terminating it completely similar to "always" but it will not start after a reboot if you stopped the container manually. This option and "always" is useful for running Docker in production.