Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the difference between a docker container and an image?

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

What is the difference between a docker container and an image? The docker image is a read-only template for the docker container runtime, and the image can be used to create a docker container.

1. Image is a unified view of a bunch of read-only layer. The following diagram can help readers understand the definition of mirror.

From the left we see multiple read-only layers that overlap. Except for the bottom layer, all the other layers have a pointer to the next layer.

These layers are implementation details within Docker and can be accessed on the file system of the host (the machine running Docker). Unified File system (union file system) technology can integrate different layers into a file system, providing a unified perspective for these layers, thus hiding the existence of multiple layers, from the user's point of view, there is only one file system. You can see the form of this perspective on the right side of the picture.

You can find files about these layers on your host file system. It is important to note that these layers are not visible inside a running container.

2. The definition of container is almost the same as that of image, and it is also a unified view of a bunch of layers, except that the top layer of the container is readable and writable.

The docker create command adds a read / write layer to the specified image, forming a new container. Notice that this container is not running.

Docker is based on mirrors. An image is similar to a virtual machine image that already contains files, configurations, and installed programs. You can start multiple mirror instances just like starting a virtual machine. A running image is called a container.

You can modify the container (such as deleting a file), but these changes will not affect the image. However, you can use the docker commit command to turn a running container into a new image.

The container cloud is realized by deploying container services on cluster servers through docker technology, with tens of thousands of Linux images, powerful, lightweight and flexible, can be easily used as cluster services, and VPCs can be built freely and easily.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report