What is the difference between kvm and docker
Differences: 1. In terms of startup speed, Docker is on the second level, while kvm is on the minute level; 2. Compared with kvm, the performance of Docker applications is high and the system overhead is small; 3. In terms of saving status , Docker is more portable and low-cost than kvm; 4. In terms of hard disk usage, Docker is measured in MB and kvm is measured in GB.
The operating environment of this tutorial: linux5.9.8 system, docker-1.13.1 version, Dell G3 computer.
Introduction to Docker
The goal of the Docker project is to implement a lightweight operating system virtualization solution. Docker is based on technologies such as Linux Containers (LXC).
Based on LXC, Docker has further encapsulated it so that users do not need to care about container management, making the operation easier. Users operating Docker containers are as easy as operating a fast and lightweight virtual machine.
The picture below compares the differences between Docker and traditional virtualization methods. It can be seen that containers implement virtualization at the operating system level and directly reuse the operating system of the local host, while the traditional method implements virtualization at the hardware level. level implementation.
Comparison between Docker and KVM (traditional virtual machine)
As an emerging virtualization method, Docker has many advantages compared with traditional virtualization methods.
1. Docker containers can be started in seconds, which is much faster than the traditional virtual machine method. Secondly, Docker has a high utilization rate of system resources. Thousands of Docker containers can be run simultaneously on one host.
2. In addition to running the application in it, the container basically consumes no additional system resources, making the application performance very high and the system overhead as small as possible. The traditional virtual machine method requires 10 virtual machines to run 10 different applications, while Docker only needs to start 10 isolated applications.
3. Virtualization technology relies on physical CPU and memory and is at the hardware level; while docker is built on the operating system and utilizes the containerization technology of the operating system, so docker can even run on a virtual machine.
4. Virtualization systems generally refer to operating system images, which are relatively complex and are called "systems"; while docker is open source and lightweight and is called "containers". A single container is suitable for deploying a small number of applications, such as A redis, a memcached.
5. Traditional virtualization technology uses snapshots to save the state; docker is not only more portable and low-cost in saving the state, but also introduces a similar source code management mechanism to store the snapshot historical versions of the container one by one. Records, switching costs are low.
6. Traditional virtualization technology is more complex when building the system and requires a lot of manpower; while docker can build the entire container through Dockfile, and restart and build quickly. More importantly, the Dockfile can be written manually, so that application developers can guide the system environment and dependencies by publishing the Dockfile, which is very beneficial to continuous delivery.
7. Of course, KVM also has a big advantage compared to containers, which is that it can use different operating systems or kernels. So, for example, you could use Microsoft Azure and run an instance of Windows Server 2012 and an instance of SUSE Linux Enterprise Server simultaneously. As for Docker, all containers must use the same operating system and kernel.
Comparison summary
Features |
Docker container |
KVM virtual machine |
##Start | seconds Level | Minute level |
Hard disk usage | Generally MB | Generally GB |
Performance |
Close to native |
Weaker than |
System support capacity |
Single machine supports thousands of containers |
Generally dozens |
# Recommended learning: "docker video tutorial"
The above is the detailed content of What is the difference between kvm and docker. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Four ways to exit Docker container: Use Ctrl D in the container terminal Enter exit command in the container terminal Use docker stop <container_name> Command Use docker kill <container_name> command in the host terminal (force exit)

How to restart the Docker container: get the container ID (docker ps); stop the container (docker stop <container_id>); start the container (docker start <container_id>); verify that the restart is successful (docker ps). Other methods: Docker Compose (docker-compose restart) or Docker API (see Docker documentation).

You can query the Docker container name by following the steps: List all containers (docker ps). Filter the container list (using the grep command). Gets the container name (located in the "NAMES" column).

Methods for copying files to external hosts in Docker: Use the docker cp command: Execute docker cp [Options] <Container Path> <Host Path>. Using data volumes: Create a directory on the host, and use the -v parameter to mount the directory into the container when creating the container to achieve bidirectional file synchronization.

The process of starting MySQL in Docker consists of the following steps: Pull the MySQL image to create and start the container, set the root user password, and map the port verification connection Create the database and the user grants all permissions to the database

Docker container startup steps: Pull the container image: Run "docker pull [mirror name]". Create a container: Use "docker create [options] [mirror name] [commands and parameters]". Start the container: Execute "docker start [Container name or ID]". Check container status: Verify that the container is running with "docker ps".

The steps to update a Docker image are as follows: Pull the latest image tag New image Delete the old image for a specific tag (optional) Restart the container (if needed)

Create a container in Docker: 1. Pull the image: docker pull [mirror name] 2. Create a container: docker run [Options] [mirror name] [Command] 3. Start the container: docker start [Container name]
