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 relationship between the docker image and the container

2025-04-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article focuses on "what is the relationship between docker image and container". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "what is the relationship between docker images and containers"?

The docker image is a read-only docker container template that contains the file system structure and contents needed to start the docker container, so it is the basis for starting a docker container.

The file contents of the docker image and some configuration files running the docker container make up the static file system runtime environment of the docker container: rootfs. It can be understood that the docker image is the static perspective of the docker container, and the docker container is the running state of the docker image.

Rootfs is the file system that is visible to the internal processes of the docker container when it starts, that is, the root directory of the docker container. Rootfs usually contains a file system that an operating system needs to run, for example, it may contain directory systems in a typical Unix-like operating system, such as / dev, / proc, / bin, / etc, / lib, / usr, / tmp, and the configuration files and tools needed to run the docker container.

Every docker container service relies on docker images. So where do we get the images we need when we first start a container with the docker run command? The answer is that if this is the first time to start the container based on an image and the required image does not exist on the host, docker will download the image from registry and save it to the host.

If the image exists on the host, the container is booted using the image on the host directly. Registry is used to hold docker images, including the image hierarchy and metadata about the images. You can think of registry simply as an entity like an Git repository.

The concept of image within docker is used to store a set of metadata information related to images, including the architecture of the image (such as amd64), the default configuration information of the image, the container configuration information for building the image, and the rootfs containing all the image layer information.

At this point, I believe you have a deeper understanding of "what is the relationship between docker images and containers". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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