Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


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.

Restart unless stopped docker policy meaning?

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

  • COLBYLICIOUSCOLBYLICIOUS Member
    edited May 2025

    I think AI can answer so good at this but I am too lazy to ask him for you, sorry.

    Thanked by 11allen
  • schwabeneschwabene Member
    edited May 2025

    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.

  • nick_nick_ Member
    edited May 2025

    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.

Sign In or Register to comment.