Docker source Analysis (iv) of the Docker Server

Source: Internet
Author: User
One, Docker server creation process

Docker server is an important part of Daemon server that receives requests sent by Docker client and implements the requested routing distribution according to the appropriate routing rules, eventually returning the result of the request processing to the Docker client.

Docker daemon starts, creates and runs the Serverapi job at the end of Maindaemon (), and lets Docker daemon provide API access services.

The entire lifecycle of Docker server

1. Create a job for Docker server
2. Configure the job's environment variables
3. Trigger Execution Job

Description: The code analyzed in this article is Docker version 1.2.0. (i) create "Serverapi" job

/docker/daemon.go /docker/daemon.go

Func Maindaemon () {...//Serve API job: = Eng.        Job ("Serveapi", flhosts ...) ...    }

When you run a SERVERAPI job, the job's processing method is executed Api.serveapi. (ii) Configuring Job environment Variables /docker/daemon.go

job. Setenvbool ("Logging",  true) job. Setenvbool ("Enablecors", *flenablecors) job. Setenv ("Version", dockerversion.) VERSION) job. Setenv ("Socketgroup", *flsocketgroup)   job. Setenvbool ("Tls", *fltls) job. Setenvbool ("tlsverify"

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.