Docker in my eyes (1) docker, vm, lxc

Source: Internet
Author: User
Tags virtual environment

Docker in my eyes (1) docker, vm, lxc
Preface

What is docker? What can docker do? Why is docker so popular? I believe many people have this question. I also have. I think docker involves too many technologies. From the linux kernel to various cloud computing solutions, it is a little difficult for me. However, after learning about docker for a month, I still want to talk about it briefly. I hope it will be helpful for beginners of docker.

Docker history

When talking about a technology, we often trace its history, which helps us better understand how it develops and what problems it solves.
Docker originated from dotclound, a foreign cool company. It was open-source and promoted on Github in 2013. The project attracted a lot of attention from the world, and the community was very active. Many Giants also participated, dotclound directly renamed itself docker ....
For more information about the development of open source docker, see this article: The Path to open source Docker.

What is Docker?

So what is docker? Docker is an LXC-based advanced container engine. Does it sound like you don't know what you're talking about? Simply put, docker is a lightweight virtual solution, or an ultra-lightweight virtual machine. You must understand what a virtual machine is. Now, you can think that docker is a virtual machine started in seconds. It can be easily created and deleted. Is it cool.
Vcq9oaPV/kernel + cores/cores + cores/nxr3MqLb4v + DE1aGjPC9wPgoKCgo8aDIgaWQ9 "docker-vs-vm"> Docker vs VM

Speaking of virtualization, the comparison with VM is inseparable. Let's take a look at the figure below:

The concept of vm is to virtualize a hardware platform on the host system and then run a different OS. This means that it requires a lot of resources. On a single machine, you can run a few virtual machines at most.

Docker is based on the kernel provided by the host machine. It only packs the features required by a different linux release version into an image, so that when you run a ubuntu image, you will feel that it is in a ubuntu operating environment, but the actually called system interfaces are all from the host machine. So when you run some kernel-related commands, you will find some clues, such as uname-a. The information provided at this time must be from the host machine.

Because the kernel of the shared host machine is used, docker requires few resources, and the performance overhead is very small. It can usually be started within seconds, and some can be started within milliseconds. On a machine, you can run thousands of docker containers at the same time.

The running mode of docker also challenges the concept of VM. If we need to virtualize a different running environment, do we need a completely new system? In fact, all we need is to run the dependent environment required by an application, isn't it?

In general, docker abandoned the traditional VM's idea of trying to simulate a complete machine. In line with the core concept of "application-oriented", it carried out "assembly and sealing" in units of applications ".

Docker vs LXC

What is LXC? LXC is the official website of Linux iner. LXC is also a lightweight virtual technology that is supported by Linux native containers. Docker is developed based on LXC, providing advanced LXC encapsulation and developing standard configuration methods.

LXC is positioned to replace traditional virtual machines and focuses on providing one operating system, such as Ubuntu and Debian. Docker is application-oriented, and officially advocates that a container is an application, focusing on the application. Therefore, docker also provides a unified packaging and deployment solution, namely, Dockerfile, version control, image reuse, and remote repository for image Sharing.
It can be said that LXC is only one of the underlying technologies of Docker, and Docker has developed an ecosystem on top of it. If there is another container virtual technology, maybe LXC is just the option in the configuration file. The libContainer project is doing this.

What is Docker doing?

Here, you should have some vague concepts about the problems solved by docker. Let's summarize them as follows:

Simplify configuration. After the development in the container is completed, it is quickly deployed in various mainstream systems, solving the problem of hell dependency and no longer having to "clearly run on my computer. The improvement of machine resource utilization does not require a large amount of resources to be consumed for a virtual environment. The traditional application delivery method has been changed, and software development and management has been transformed from inter-department assembly and debugging to simple replacement of components. Software management and sharing are upgraded from the code level to the application level. It gives us more freedom of choice and makes the software architecture more flexible. For details, see: here

Maybe docker will become a new software management model in the future. We will not see developers writing configuration files for different release versions to handle complex system dependencies. No matter what services we need, we only need to install docker and then pull an image to the local. In fact, we have begun to see this trend. After all, docker is too convenient for development and testing.
As for the significance of docker in cluster automatic deployment, I 'd like to share this article: chatting about Cluster Management Mode

It's a little long. See the next article.

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.