Home  >  Article  >  Operation and Maintenance  >  Why is docker lightweight?

Why is docker lightweight?

WBOY
WBOYOriginal
2022-07-28 16:05:383645browse

The reason why docker is a lightweight virtualization technology is that "the docker image is small in size"; docker virtualization is built on the operating system, and different versions of the Linux kernel are basically the same, so no installation operation is required For the system kernel, you only need to introduce the image of the corresponding operating system. The image contains the corresponding file system, so the size of the docker image is very small.

Why is docker lightweight?

The operating environment of this tutorial: linux7.3 system, docker version 19.03, Dell G3 computer.

Why docker is lightweight

Lightweight: the docker image is small in size

Docker is a lightweight, one-time package that can be used anywhere Running virtualization technology.

Operating system volume:

The normal running of programs on the system cannot be separated from the operating system. A complete operating system consists of two parts: kernel and file system.

For traditional virtual machines, the kernel and file system need to be completely installed, so they occupy a very large space. For example, Ubuntu requires 20G.

As far as docker is concerned, virtualization is built on the operating system, and different versions of the Linux kernel are basically the same. Therefore, there is no need to install the operating system kernel. You only need to introduce the image of the corresponding operating system. However, the corresponding file system is included in the image. Therefore, the size of the docker image is very small. It is also Ubuntu, and the docker image is only 80M.

What are the advantages and disadvantages of docker?

Advantages:

(1) Lightweight: the docker image is small in size

(2) [endif] Fast: can be generated quickly Container

(3) [endif] Consistency: Development->Testing-Operation and Maintenance online system environment is completely consistent

(4) Unified management: Images are uploaded to the image library in a unified manner to facilitate traceability Rollback

(5) Low environment dependency: Since each container has its own file system, dependent environments can be installed independently. Therefore, the dependence on external operating systems is extremely low

(6) High resource utilization: avoid the waste of hardware resources by the respective systems in the virtual machine

Disadvantages:

(1) Architecture requirements: must be 64-bit

(2) System requirements: Kernel 3.8.0 or above

(3) Isolation is not complete: because it is at the system level Virtualization, memory overflow, and high CPU usage may affect the stability of Docker

Recommended study: "docker video tutorial"

The above is the detailed content of Why is docker lightweight?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn