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
Default image
Sriram Mannava

I'm a full-stack developer and a software enthusiast who likes to play around with cloud and tech stack out of curiosity.

Leave a Reply