What are restart policies?

docker restart policies dictate how a container should behave when it is shutted down by some factor.

There are four restart-policies:

  • No - Never restart when stopped by some means
  • Always - Always restart no matter how it is stopped
  • On-Failure - Restart only when the container stops with an erroneous code
  • Unless-Stopped - Restart always unless stopped manually with a KILL or STOP

docker restart policies dictate how a container should behave when it is shutted down by some factor.

There are four restart-policies:

  • No – Never restart when stopped by some means
  • Always – Always restart no matter how it is stopped
  • On-Failure – Restart only when the container stops with an erroneous code
  • Unless-Stopped – Restart always unless stopped manually with a KILL or STOP

Buy Me A Coffee

Found this article helpful? Please consider supporting!

Ram
Ram

I'm a full-stack developer and a software enthusiast who likes to play around with cloud and tech stack out of curiosity. You can connect with me on Medium, Twitter or LinkedIn.

Leave a Reply

Your email address will not be published. Required fields are marked *