Docker-1 first knowledge of Docker

Source: Internet
Author: User

five minutes to meet DockerWhat is Docker?

Think of him as an ultra-lightweight virtual machine that is implemented in a novel way, which is probably the right thing to do. Of course, in the implementation of the principle and application is still a huge difference with the VM, and the professional term is the application container (application Container).

Why use Docker?

So what does the application container look like, a good application container looks like a virtual machine with a specific set of applications installed. For example, I want to use MySQL now, I will find a container to install MySQL, run up, then I can use MySQL.

So I just installed a MySQL is not good, why still need this container so strange concept? That's what it says, but if you're going to be a real load of MySQL, you might want to install a bunch of dependent libraries, set up according to your operating system platform and version, and sometimes compile a bunch of inexplicable errors from source code, not so well-fitted. And in case your machine hangs up, everything will have to come back and you may have to reconfigure the configuration again. But with the container, you have a virtual machine that can run, and as long as you can run the container, the configuration of MySQL is the province. And once you want to change the machine, just put the container up and put it on another machine. Hardware, operating system, operation environment and so on do not need to consider.

A big use in the company is to ensure that the offline development environment, the test environment and the production environment on the line are consistent. That year in the * * * often encountered such a thing, development to do something to test, will generally give a piece of code and a introduction to the online step of the order. The result code in the test machine can not run up, development ran to see the problem, a moment Ah this configuration file forgot to submit, a while AH this line command is wrong. Found a bug put up, development a look, ah how I forgot to write this command on the online list. Something like this will happen on the go, and it's a different version of your software than my machine ... At the time of the * * *, because a development directly to the above three positions, and a set of automated deployment mechanism so the problem will be less, but on the line when people are still frightened.

If the use of containers, then the development of directly in the container development, the test when the entire container for testing, measured the change in the container and then put on the line. Through the container, the entire development, testing and production environment can maintain a high degree of consistency.

In addition, the container and the VM have a certain degree of isolation, the data and memory space between each container is isolated from each other, can guarantee a certain degree of security.

The problem that Docker can solve to a large extent
    • Software updates release inefficiencies
    • Business is not agile
    • Environmental consistency, difficult to guarantee
    • Migration costs are too high between different environments
    • Software developers, long delivery cycles – high cost
So why not use VMS?

So since containers and VMS are so similar, why not just use VMS to complete the concept of a container? The Docker container has several advantages over VMS:

    • Fast Start-up, containers typically start in less than a second, and VMS typically take longer
    • High utilization of resources, a common PC can run thousands of containers, you run thousands of VMs to try
    • With little performance overhead, VMS typically require additional CPU and memory to complete the functionality of the OS, which takes up additional resources

Why do similar functions have such a large gap in performance, in fact, it is related to the concept of their design. The design diagram for the VM is as follows:

VM Hypervisor requires virtualization of the hardware and the ability to carry its own operating system, which naturally has significant overhead in boot speed and resource utilization and performance. And Docker's design is this:

Docker has almost no virtualization, and directly re-use the host's OS, the Docker Engine level to achieve the scheduling and isolation of the weight of a sudden reduction of several grades. Docker containers take advantage of LXC, management leverages namespaces to control and isolate permissions, cgroups to configure resources, and further improve file system resource utilization through AUFS.

The AUFS is a very interesting thing, is a kind of UnionFS. His mind is somewhat similar to git, and can be used as a layer of overlay for a commit to a file system. In this way, multiple containers can be shared between their file system hierarchy, each container below is a shared file system hierarchy, which is the same level of file system changes, which greatly save the need for storage, and also can speed up the container start.

2016.10.27 00:20

Docker-1 first knowledge of Docker

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.