Docker Supervisor Process Management

Source: Internet
Author: User
Tags docker run

Bo Master qq:819594300

Blog Address: http://zpf666.blog.51cto.com/

Have any questions friends can contact Bo Master, Bo Master will help you answer, thank you for your support!

I. using Supervisor to manage processes

Docker The container opens a single process at startup, such as an SSH or Apache daemon service. However, we often need to open multiple services on a machine, this can be many ways, the simplest is to put a number of startup commands in a startup script, start the time to start the script directly .

Example: Docker run–d mirroring/run.sh

The installation process management tool is also installed.

This section uses the Process Management tool supervisor to manage multiple processes in the container. use Supervisor to better control, manage, and restart the processes we want to run .

Supervisor is a Process control system. It is a C/s system (Note: It provides a web interface to the user for querying and controlling), which allows the user to monitor and control the process of the Unix-like system.

Demonstrate how to use both SSH and Apache services.

1 first create a Dockerfile, and the contents and sections are explained below.

Dockerfile File Contents:

650) this.width=650; "src=" https://s3.51cto.com/wyfs02/M00/8E/D9/wKioL1jNAeqAr0DxAAFeA_YSKpI787.jpg "style=" float : none; "title=" image001.jpg "alt=" Wkiol1jnaeqar0dxaafea_yskpi787.jpg "/>

650) this.width=650; "src=" https://s3.51cto.com/wyfs02/M01/8E/DB/wKiom1jNAevho5IuAAIQ4k9Usko687.jpg "style=" float : none; "title=" image002.jpg "alt=" Wkiom1jnaevho5iuaaiq4k9usko687.jpg "/>

2 ) Supervisor configuration file contents:

650) this.width=650; "src=" https://s5.51cto.com/wyfs02/M01/8E/D9/wKioL1jNAezQv923AAB8ML9BlOY249.jpg "style=" float : none; "title=" image003.jpg "alt=" Wkiol1jnaezqv923aab8ml9bloy249.jpg "/>

650) this.width=650; "src=" https://s1.51cto.com/wyfs02/M02/8E/DB/wKiom1jNAe6AqpFrAASQeNPRwb0123.jpg "style=" float : none; "title=" image004.jpg "alt=" Wkiom1jnae6aqpfraasqenprwb0123.jpg "/>

3 )/docker/apache directory content List 650) this.width=650; "Src=" Https://s5.51cto.com/wyfs02/M01/8E/D9/wKioL1jNAe_ X4ymfaacxbc2tjpy820.jpg "style=" Float:none; "title=" image005.jpg "alt=" Wkiol1jnae_x4ymfaacxbc2tjpy820.jpg "/>

4 ) How to use

① turn on the Routing and forwarding function and turn off SELinux

650) this.width=650; "src=" https://s5.51cto.com/wyfs02/M02/8E/DB/wKiom1jNAe_yv-uVAAFt-hTD3VA340.jpg "style=" float : none; "title=" image006.jpg "alt=" Wkiom1jnae_yv-uvaaft-htd3va340.jpg "/>

② Creating an image

650) this.width=650; "src=" https://s5.51cto.com/wyfs02/M02/8E/D9/wKioL1jNAe_QjrT-AABld2WkIWw411.jpg "style=" float : none; "title=" image007.jpg "alt=" Wkiol1jnae_qjrt-aabld2wkiww411.jpg "/>

③ Viewing Mirrors

650) this.width=650; "src=" https://s5.51cto.com/wyfs02/M00/8E/DB/wKiom1jNAfCAf4S4AACNVB4dQcw281.jpg "style=" float : none; "title=" image008.jpg "alt=" Wkiom1jnafcaf4s4aacnvb4dqcw281.jpg "/>

④ Starting the Supervisor container

650) this.width=650; "src=" https://s5.51cto.com/wyfs02/M02/8E/D9/wKioL1jNAfCCY1uPAADrKfWxslU442.jpg "style=" float : none; "title=" image009.jpg "alt=" Wkiol1jnafccy1upaadrkfwxslu442.jpg "/>

⑤ testing: Accessing the Web and SSH services provided by the container

650) this.width=650; "src=" https://s5.51cto.com/wyfs02/M00/8E/D9/wKioL1jNAfHhE_tHAAEs244wOoY398.jpg "style=" float : none; "title=" image010.jpg "alt=" Wkiol1jnafhhe_thaaes244wooy398.jpg "/>

650) this.width=650; "src=" https://s2.51cto.com/wyfs02/M01/8E/DB/wKiom1jNAfLxlYsPAALGutTDS_w855.jpg "style=" float : none; "title=" image011.jpg "alt=" Wkiom1jnaflxlyspaalguttds_w855.jpg "/>

650) this.width=650; "src=" https://s2.51cto.com/wyfs02/M00/8E/DB/wKiom1jNAfKDMkZSAAHnZuomBIg128.jpg "style=" float : none; "title=" image012.jpg "alt=" Wkiom1jnafkdmkzsaahnzuombig128.jpg "/>

Summary: Dockersupervisor is similar to the previous dockerfile, where the difference is that Dockerfile uses a RUN.SH script-initiated application process, and Docker Supervisor application processes that are open using the Supervisor Process Management tool. Replaced the run.sh script file with the supervisor file.

Docker Supervisor Process Management

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.