Automatically exits the solution after the Docker container starts executing the L script

Source: Internet
Author: User

A recent project has a launch container that automatically executes a script to launch an app, and finds that the container exits automatically when the script finishes executing. problem Analysis a Docker container can manage only one process at a time, and when the process exits, the container exits, and of course a container may run multiple processes at the same time. After the container has started executing a script, the process is finished and the other processes are finished, so the container exits automatically, and the solution: we can keep the script running without stopping.
The solution adds tail-f/dev/null to the last line of the script, which is never done, so the script will never be executed, so the container does not quit.

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.