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

The relationship between Container and Image in docker

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article introduces the knowledge of "the relationship between containers and mirrors in docker". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The entire life cycle of docker consists of three parts: image + container + repository. The container is instantiated from the image.

It can also be said that the image is a file and the container is a process. The container is created based on the image, that is, the processes in the container depend on the files in the image.

Docker's concept of mirroring is similar to the mirroring of virtual machines. Is a read-only template, a separate file system, including the data needed to run the container, which can be used to create a new container.

Docker uses containers to run applications: docker containers are running instances created by docker images.

The docker container is similar to a virtual machine and can be executed including start, stop, delete, etc. Each container is isolated from each other. A specific application is run in the container, containing the code for the specific application and the required dependent files. Think of the container as a simple version of the linux environment (including root user rights, process space, user space, cyberspace, etc.) and applications running in it.

In the life cycle of Docker, there are two core parts, one is the mirror Images and the other is the container Containers. When the image runs, it is the container. During the operation of CCS, changes are made based on the original image, such as installing the program, adding files, or submitting it back (commit) to become an image.

If you have installed a system, the image is a bit like a GHOST image. If you install a system from a GHOST image and run it, it is equivalent to a container. The container comes with applications, just like the system installed by GHOST image is not a naked operating system, and some software may be installed in it. During the use of the installed system, other software is installed, or files are downloaded, and the system can be re-GHOST into an image. When others reinstall the system through this image, the other software comes with it.

An ordinary GHOST image is a file, but it is not easy to manage. For example, if you have dozens of GHOST images, you may not remember which version of the software is installed in which image. So the container image has the concept of tag, which is a tag, such as dev-1.0,dev-2.0,production-1.1, which can help you distinguish between different images.

For the unified management of images, there is a mirror library. You can store local images in a unified image library through push, and you can pull images from the image library locally through pull.

That's all for the content of "the relationship between containers and images in docker". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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