What's a docker?

Source: Internet
Author: User

When it comes to Docker, everyone should be familiar, from the beginning of 2013 to now, in just two years, quickly became the most popular open-source cloud computing project after OpenStack.

So what causes Docker to be so hot?

I am also interested, so I will use Docker to practice this series of blog posts, documenting my knowledge and practice of Docker.

This article focuses on what Docker is, and the difference between Docker and traditional virtualization.


What is Docker?

Docker, a LXC (LinuX Container)-based advanced container engine that uses go language development, follows the APACHE2.0 protocol, and all open source code is hosted on GitHub (https://github.com/ Docker/docker). It was born in early 2013 and was originally launched by DotCloud Corporation, which has now been renamed Docker INC, focusing on the development of Docker-related technologies and products.

Currently, the mainstream Linux, Windows, and Macs already support Docker. It is important to note that since Docker is based on LXC, it is possible to run Linux on a virtual machine and then run Docker on Linux, in addition to the Linux operating system.

The main goal of Docker's birth is "build,ship and Run any App,anywhere", that is, through encapsulation (packaging) of application components, distribution (Deployment), Deployment (Deployment), Run (runtime) and other lifecycle management, at the application component level of "one package, run everywhere". The application component here can be either a Web application or a set of database services, or even an operating system or compiler.


What is LXC?

The foundation of the Docker engine is the Linux container (Linux container,lxc) technology. An accurate description of the container technology is given on the IBM Develperworks:

containers effectively divide resources managed by a single operating system into orphaned groups to better balance conflicting resource usage requirements among orphaned groups. This requires neither instruction-level emulation nor immediate compilation, as compared to virtualization . The container can run instructions locally on the core CPU without requiring any special interpretation mechanism. In addition, the complexity of quasi-virtualization (paravirtualization) and system call substitution is avoided.

liunux containers are not a completely new concept, and early container technologies include chroot, Solaris Containers, FreeBSD jail, Linux-vserver, Solaris Zones, OpenVZ, Lxc and so on. Although these technologies have evolved very early, they are not integrated into the Linux kernel, and are inconvenient to use, such as OPENVZ, which requires a specific inner-box patch to be used by the operating system first. The LXC project draws on the predecessor's mature container design concept, and gives a new set of kernel features to achieve a more scalable virtualization container solution, and is integrated into the mainstream Linux kernel, thus becoming the de facto standard of lightweight container technology for Linux systems.

on the basis of LXC, Docker has made great improvements, such as:

1, LXC positioning is as a virtual machine alternative. While all software can be installed in containers managed by LXC or Docker, Docker prefers to run an application in one container

2, each LXC container may not be compatible, but Docker uses a standard configuration method to make the LXC created by different Docker fully compatible

3, Docker implements a git-like version of the container versioning method, and can be incrementally updated.

4. You can create a base image and save it in a remote repository (repository) for reuse, and other containers can be created on top of it and saved as a new image.

5, Docker provides a variety of container management tools (such as distribution, version, migration, etc.) so that users do not need to focus on the underlying operations, can easily and clearly manage and use the container

6, Docker manages a public image library to facilitate users to share their own image, while the company can also construct its own private image library.

7. The Docker container is built from Dockerfile, and you can run any commands and programs as needed during the build of the image.

8. Because Docker is becoming more popular, there are a number of ways to easily integrate it into the development process, such as using a unified approach to build containers for environments and development environments that are continuously integrated.


The difference between Docker and virtual machine

In fact, both Docker and virtual machines are virtualization technologies. And virtualization technology has a lot of different kinds. such as VMS, KVM, and the virtualization of the early Xen. Docker, however, belongs to OS-level virtualization.

virtual machines such as VMS, KVM, and Docker are a lightweight way to virtualize, so What are the significant advantages of Docker in running applications with traditional virtual machine approaches?

1, Docker container quickly, start and stop can be implemented in seconds, which is much faster than the traditional virtual machine mode

2. Docker containers have few requirements on system resources and can run thousands of Docker containers simultaneously on one host

3. Docker makes it easy for users to obtain, distribute and update application images via git-like operations, with concise instructions and low learning costs

4. Docker supports flexible automation creation and deployment mechanisms through Dockerfile configuration files to increase productivity


Here is a comparison of the features of Docker container technology and traditional virtual machine technology:

Characteristics Container Virtual machines
Start speed Second level Minute level
Hard disk use is generally MB typically GB
Performance Close to native Weaker than
System Support Volume Stand-alone support for thousands of containers Dozens of general
Isolation of Safety Isolation Safety Isolation

What is the cause of these advantages of Docker? We can look first:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6C/A1/wKiom1VONxiTVjjmAAF7viqcvXA143.jpg "title=" Qq20150510000442.png "alt=" Wkiom1vonxitvjjmaaf7viqcvxa143.jpg "/>

Traditional virtualization is virtualized at the hardware level, requiring additional virtual machine management applications and virtual machine operating system tiers, while Docker containers do not require these two tiers, but instead directly use the system invocation interfaces of the operating system. Because of this, the Docker container, in addition to running the application, basically does not consume additional system resources, ensure the performance of the application, while minimizing the system overhead. Traditional virtual machines, running n different applications to start N virtual machines (each virtual machine needs to allocate memory, disk and other resources), and Docker only need to start n isolated containers, and put the application into the container, which reduces the amount of resource consumption.


The benefits of Docker in the software development process

at the beginning of the design, Docker has several purposes:

1. Strengthen the development environment for developers to write code and the consistency of the production environment to be deployed by the application, thus reducing the risk of "developing all normal, certainly operational issues".

2, shorten the code from development, testing to deployment, on-line running cycle, so that your program can be executed, easy to build, and easy to collaborate

3. Docker encourages service-oriented architecture and microservices architecture. Docker recommends a single container to run an application or process, thus creating a distributed Application Model

with Docker, developers only need to care about the applications running in the container, and OPS only need to care about how to manage the containers.

Overall,DOcker has the following advantages in the development and operations process:

1. Faster delivery and deployment

2, more efficient use of resources. Docker containers run without additional hypervisor (VMM, and hypervisor) support, which is kernel-level virtualization for higher performance while requiring low resource requirements

3. Easier migration and expansion

4, the more simple update management. With Dockerfile, only a small configuration change is required to replace a large number of previous updates, and all modifications are distributed and updated incrementally, enabling automated and efficient container management.


Ok!

The above is the entire content of this article, the other content of Docker, will appear in the next blog post.

This article is from the "not only Linux" blog, so be sure to keep this source http://nolinux.blog.51cto.com/4824967/1649923

What's a 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.