Docker container boot automatically start __docker

Source: Internet
Author: User
Tags docker run

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.