Science And Technology Museum

Basic knowledge of Docker

by Miles Warren
January 08,2021

Docker is a popular container technology. And as a developer, you've probably heard of it or used it. Many people may think of Docker as a lightweight virtual machine. But Docker and virtual machine (VM) are two different computer virtualization technologies. Many people think, with virtual machines, why use Docker?

If you think about it, in the "ancient" days before computing virtualization, what would be the typical steps if we were to deploy an application?

The first step is certainly to prepare a physical server and then install an Operating System on the physical server. Once we have an operating system, we install and run our application on the operating system,

However, this deployment was very slow. Because we had to prepare the hardware servers and install the operating system. Then deploy applications that have a lot of dependencies on software. Not only is the process slow, but the cost is also very high. Mainly because the cost of the physical device is so high that even a simple application deployment requires a server. If the application is too simple, it will also waste hardware resources.

The only way to solve these problems is through virtualization,

The advantages of virtual machines

Resources can be allocated to different virtual machines to maximize the use of hardware resources.

Virtual machines are easier to scale applications than deploying them directly on a physical machine.

Cloud services: Virtual out different physical resources through the virtual machine, you can quickly build cloud services.

Shortcomings of virtual machines

The weakness of virtual machines' comes from the consumption of physical server resources. When we create a virtual machine on a physical server, we need to virtual out a set of hardware. And run a full operating system on it. Each virtual machine takes up a lot of server resources. What is Docker?

Compared with the bulky virtual machine, Docker is more lightweight. So it does not take up too much system resources.

Docker is developed using the currently popular Golang language. Its technical core is Cgroup of Linux kernel, Namespace, Union FS of AUFS class and other technologies. These are technologies that have been in the Linux kernel for many years. So it's not strictly a completely innovative technology. Docker encapsulates and isolates The Linux process through these underlying Linux technologies. And the isolated process is also known as the container, which is completely independent of the host process.

Therefore, Docker is an implementation of container technology. And a kind of virtualization at the operating system level. It's completely different from a virtual machine that installs the operating system through a set of hardware.

Docker is the isolation at the level of the operating system process. While the virtual machine is the isolation at the level of physical resources, which are completely different. We can also understand the fundamental difference between the two by comparison.

  • Miles Warren
  • January 08,2021

Leave a Reply