Talk about my understanding of docker

  • 2020-05-17 07:09:43
  • OfStack

Let me give you the concept of docker

Docker is an open source engine that makes it easy to create a lightweight, portable, self-contained container for any application. Containers that developers compile and test on their laptops can be deployed in bulk in production environments, including VMs (virtual machine), bare metal, OpenStack clusters, and other basic application platforms.

Docker advantage:

Faster delivery and deployment (once created and configured, you can run from anywhere)

More efficient virtualization (no hypervisor support, kernel-level virtualization)

Easier migration and scaling (porting on any platform)

Simpler management ()

About docker understanding

1. The first is about virtualization

Virtualization can be simply understood as a way of resource management. There are several ways to virtualize:

1. Complete virtualization: complete virtualization of the underlying hardware. For example: Vmware Workstation

2. Partial virtualization: the virtualization of only part of the hardware resources.

3. Operating system-level virtualization: the kernel isolates processes by creating multiple virtual operating system instances.

docker is operating system-level virtualization.

2. The second is the understanding of docker

The idea of docker comes from container. What problem does container solve?
Imagine, in a big ship, can put the goods neatly. And all kinds of goods are standardized by container, container and container will not affect each other. Then I don't need a boat for fruit and a boat for chemicals. As long as the goods are well packed in the container, I can ship them all by a big ship. docker is a similar idea. Cloud computing is all the rage now. Cloud computing is like a big freighter, and docker is a container.

Advantages of Docker:

Faster delivery and deployment

Different applications may have different application environments. For example, websites developed by.net and.php rely on different software. If all the software they rely on are installed on a single server, it will take a long time to debug, which will not only be troublesome, but also cause some problems such as access port conflicts between IIS and Apache. At this point you have to isolate the website developed by.net from the website developed by.php. In general, we can create different virtual machines on the server and deploy different applications on different virtual machines, but virtual machines are expensive. At this point, docker can realize the function of virtual machine to isolate different applications, and the cost is smaller than virtual machine. Small means saving money.

2. Easier migration and expansion

Let's take another simple example. You develop with Ubuntu, for example, but are CentOS of operations management, operations in your software development from the development environment to the production environment will encounter when 1 turn Ubuntu CentOS problems, such as: there is a special version of the database, support Ubuntu only and does not support CentOS, then in the process of transfer will have to think of some way to solve this problem. But then if you have docker, you can just encapsulate the development environment and transfer it to operations, and operations can just deploy the docker that you gave them. And it's fast to deploy.

3. More efficient virtualization and simpler management

In terms of server load, if you run a single virtual machine, the virtual machine will use the free memory of the docker deployment, and this memory will be effectively utilized. Moreover, the Docker container does not require additional hypervisor support to run; it is kernel-level virtualization, thus enabling higher performance and efficiency.

Three basic concepts of Docker:

Mirror, container, warehouse

3. A detailed explanation of the three basic concepts of Docker

1. The mirror

Docker in English means "object/docker" and docker container means a container of objects. For example, we often install windows operating system, we must download ISO image files from the Internet, after decompression can be installed and used. Docker is also 1. To create an docker container, we need to create an docker image of the container similar to the ISO image.

2. The container

I'm sure you're familiar with containers. Yes, the docker container is used to manage applications of different architectures. Essentially, a container is a running instance created from an image. Containers are isolated from each other, and each container is a secure platform.

3. The warehouse

A warehouse is a centralized repository for mirrored files, but there are two concepts to distinguish between: a warehouse and a warehouse service registry. The warehouse registration server often holds multiple warehouses, and each warehouse contains multiple images.

Warehouses are divided into public and private warehouses. The largest public warehouse is Docker Hub, which holds a large number of images for users to download. Domestic open warehouses include Docker Pool, etc., which can provide users in mainland China with more stable and fast access.

In addition, users can create a private repository within the local network. Once the user has created his own image, he can use the push command to upload it to a public or private repository, so that the next time he USES the image on another machine, he can simply drop pull from the repository.

Summary:

As a new virtualization method, Docker has many advantages over traditional virtualization methods.

First, the Docker container can be started in seconds, which is much faster than the traditional virtual machine approach. Second, Docker has a high utilization rate of system resources. Thousands of Docker containers can be run on one host at the same time.

The container consumes almost no additional system resources other than running its applications, resulting in high application performance and minimal overhead. Whereas traditional virtual machines require 10 virtual machines to run 10 different applications, Docker only needs to start 10 separate applications.


Related articles: