What is the difference between docker import and docker load?

青灯夜游
Release: 2020-07-17 13:42:48
Original
12282 people have browsed it

Difference: The docker load command imports the image library storage file to the local image library; the docker import command imports a container snapshot to the local image library. Container snapshots will discard all history and metadata information, while image storage files will retain complete records and will be larger in size.

What is the difference between docker import and docker load?

First of all, if you want to clearly understand the difference between the docker load and docker import commands, you must understand the image Differences from containers:

  • Image: The read-only template used to start the container is the rootfs required for container startup, similar to the image used by the virtual machine.
  • Container: Docker container is an open source application container engine that allows developers to package their applications and dependency packages into a portable container, and then publish it to any popular Linux machine. It can also be implemented Virtualization.

The image is the basis of the container. It can be simply understood that the image is the image we need to start the virtual machine. The container is the service that runs after the virtual machine is successfully started.

If you want to understand the difference between the docker load and docker import commands, you must also know the docker save and docker export Command:

  • docker save images_name: Export an image as a file, and then use the docker load command to import the file as an image. Save all history of this image. It is larger than the file exported by the docker export command and is easy to understand because all the history of the image will be saved.
  • docker export container_id: Export a container as a file, and then use the docker import command to import the container into a new image, but compared to docker save command, the container file will lose all metadata and history records, and only save the current state of the container, which is equivalent to a virtual machine snapshot.

The difference between docker import and docker load

In fact, you can use the docker load command to import the image library storage file to the local image library , you can also use the docker import command to import a container snapshot into the local image library.

The difference between the two is that container snapshots will discard all historical records and metadata information, while image storage files will save complete records and will be larger in size. In addition, when importing from a container snapshot file, you can also re-specify metadata such as tags.

Recommended tutorials: "docker tutorial", "PHP tutorial"

The above is the detailed content of What is the difference between docker import and docker load?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template