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 are the ways to generate docker images?

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

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "what are the ways to generate docker images". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn what are the ways to generate docker images.

Can multiple containers in docker correspond to one image? Yes, an image can create multiple containers, each with its own read / write layer, and these layers share the image below independently of each other.

The image is static, and each layer of the image is only readable, while the container runs the specified application dynamically. The application in the container may create a file and modify a directory. The changes brought about by these operations will not affect the image, because the image is only readable. Therefore, to create a container through an image is to add a read-write layer to the image.

Using a single image to create multiple micro-service instances to achieve the purpose of expanding the service, the main difficulty is to use the configuration file to start different instances.

The image contains the file system and contents needed to start the container, which can be understood as packaged files that are used to create and start the docker container.

There are three ways to generate an image:

1. Based on dockerfile implementation, image production of program files

two。 Based on the container implementation, after starting the container, make the new operation as a new image

3.docker hub automated builds

The image file is built in a hierarchical mechanism, with bootfs at the bottom and multiple layers on rootfs,rootfs. The image file at the lowest level is the parent image (parent image), and the bottom layer is the basic image (base image,rootfs is this layer, which must exist). The top layer is the "read-write" layer, and the bottom layer is the "read-only" layer.

Thank you for your reading. The above is the content of "what are the ways to generate docker images". After the study of this article, I believe you have a deeper understanding of the ways to generate docker images, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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