Difference between revisions of "Docker - Restart Docker container automatically if it crashed"

(Created page with "Restart container when it crashes <pre>docker run --name nginx-con --restart=always</pre> --restart=always - will cause the container to automatically restart, in case the n...")
 
 
Line 4: Line 4:
  
 
--restart=always - will cause the container to automatically restart, in case the nginx daemon running inside it would crash or segfault.
 
--restart=always - will cause the container to automatically restart, in case the nginx daemon running inside it would crash or segfault.
 +
 +
[[Category: Docker]]

Latest revision as of 12:03, 13 October 2019

Restart container when it crashes

docker run --name nginx-con --restart=always

--restart=always - will cause the container to automatically restart, in case the nginx daemon running inside it would crash or segfault.