When you deploy a Project Server, the Docker container is set to start automatically, in response to power outages and other conditions that affect access to normal Web projects.
When you use the Docker run to start the container, use the--restart parameter to set:
[plain] view plain copy ~ Docker run-m 512m--memory-swap 1g-it-p 58080:8080--restart=always--name Bvrfis --volumes-from logdata mytomcat:4.0/root/run.sh--restart Specific parameter value details:
No-when the container exits, does not restart the container;
On-failure-Starts a new container only when a non-0 state exits;
Always-reboot the container regardless of the exit state;
If--restart=always is not specified at creation time, it can be set by the update command
Docker update--restart=always XXX
You can also specify the maximum number of times that Docker will attempt to restart the container when using the On-failure policy. By default, Docker will attempt to restart the container forever.
[plain] view plain copy # sudo docker run--restart=on-failure:10 Redis
Reprint Address: http://blog.csdn.net/lin521lh/article/details/78413631