[go: up one dir, main page]

CN110908686A - Container mirror image replacing method - Google Patents

Container mirror image replacing method Download PDF

Info

Publication number
CN110908686A
CN110908686A CN201911118464.1A CN201911118464A CN110908686A CN 110908686 A CN110908686 A CN 110908686A CN 201911118464 A CN201911118464 A CN 201911118464A CN 110908686 A CN110908686 A CN 110908686A
Authority
CN
China
Prior art keywords
mirror image
layer
container
new
updating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911118464.1A
Other languages
Chinese (zh)
Other versions
CN110908686B (en
Inventor
李小平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xi'an Lei Feng Electronic Technology Co Ltd
Original Assignee
Xi'an Lei Feng Electronic Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xi'an Lei Feng Electronic Technology Co Ltd filed Critical Xi'an Lei Feng Electronic Technology Co Ltd
Priority to CN201911118464.1A priority Critical patent/CN110908686B/en
Publication of CN110908686A publication Critical patent/CN110908686A/en
Application granted granted Critical
Publication of CN110908686B publication Critical patent/CN110908686B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a container mirror image replacing method, which is characterized in that a new mirror image layer is added on an original container mirror image layer through dockfile, a system and pre-installed application software in the mirror image are updated to generate a new mirror image, and the original container mirror image is replaced into the new mirror image, so that batch coverage updating is realized. The replacement method of the invention greatly improves the maintenance efficiency of the template mirror image, and the updating of the software is more flexible through the updating of the template mirror image, so that an administrator can modify the updated software at the background at any time without worrying about the influence on the user data, the patch updating of the system is realized, and the batch updating of the software is safer, more reliable and more efficient.

Description

Container mirror image replacing method
Technical Field
The invention relates to the technical field of computer information processing, in particular to a container mirror image replacing method.
Background
The root file system of the Docker container consists of a container mount layer, a container init layer and a mirror file layer. The mirror file layer is a read-only container template containing the file system structure and its contents needed to start the container. These file contents and the configuration file for running the Docker container constitute the static file system running environment of the container: a root file system.
The Docker image, i.e., the image file layer, is a read-only multi-layer structure that is used by containers in a read-only manner. The container mirror builds the system and is used as a template in batch after application software is pre-installed. Once a container is created using the image, the image layer cannot be replaced or modified. It is very difficult to readjust the system software or the pre-installed application software in the template image.
Disclosure of Invention
In order to overcome the problems in the prior art, the invention provides a container mirror image replacement method, which is characterized in that a new mirror image layer is added to the original container mirror image through dockfile, a system and pre-installed application software in the mirror image are updated to generate a new mirror image, and then the original container mirror image is replaced into the new mirror image, so that the purpose of batch updating is achieved, and user data and software of the operated container are not influenced.
In order to achieve the purpose, the invention provides the following technical scheme:
a container mirror image replacing method is characterized in that a new mirror image layer is added on an original container mirror image layer through dockfile, a system and pre-installed application software in the mirror image are updated to generate a new mirror image, the original container mirror image is replaced to be the new mirror image, and batch coverage updating is achieved.
Further, the method comprises the following steps:
s1, modifying the container configuration file, and replacing the ID and the name of the original mirror image as the ID and the name of the new mirror image;
s2, acquiring a new image file top layer, an init layer and a mount layer lower linked list of the container through a Docker API;
s3, reconstructing an init layer lower linked list to point to a new mirror image;
s4, writing the init layer lower linked list into a lower file under the layer cache directory;
s5, reconstructing a mount layer lower linked list to point to a new init layer;
and S6, entering a mount layer lower link list to a lower file under the layer cache directory.
The container mirror image replacement method greatly improves the maintenance efficiency of the template mirror image: the updating of the software is more flexible through the updating of the template mirror image, an administrator can modify the updated software at the background at any time without worrying about the influence on user data, the patch updating of the system is realized, and the batch updating of the software is safer, more reliable and more efficient.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic diagram of a mirror file layer before replacement according to the present invention;
FIG. 2 is a schematic diagram of the image file layer after the replacement of the present invention;
fig. 3 is a schematic diagram of an alternative method of the present invention.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it is to be understood that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention relates to a container mirror image replacing method, which adds a new mirror image layer on an original container mirror image layer through dockfile, updates a system and pre-installed application software in the mirror image to generate a new mirror image, and then replaces the original container mirror image into the new mirror image to realize batch coverage updating.
As shown in fig. 1 and 2, after the original image is updated, a new image file layer N +1 is added, and a new image is generated. The container init layer is then pointed to the new mirror and the container mount layer to the new container init layer.
Specifically, as shown in fig. 3, the alternative method of the present invention comprises the steps of:
s1, modifying the container configuration file, and replacing the ID and the name of the original mirror image as the ID and the name of the new mirror image;
s2, acquiring a new image file top layer, an init layer and a mount layer lower linked list of the container through a Docker API;
s3, reconstructing an init layer lower linked list to point to a new mirror image;
s4, writing the init layer lower linked list into a lower file under the layer cache directory;
s5, reconstructing a mount layer lower linked list to point to a new init layer;
and S6, entering a mount layer lower link list to a lower file under the layer cache directory.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (2)

1. A method of replacing a container image, comprising: and adding a new mirror image layer on the original container mirror image layer through dockfile, updating a system and pre-installed application software in the mirror image to generate a new mirror image, and replacing the original container mirror image into the new mirror image to realize batch coverage updating.
2. A method of replacing a container image according to claim 1, wherein: the method comprises the following steps:
s1, modifying the container configuration file, and replacing the ID and the name of the original mirror image as the ID and the name of the new mirror image;
s2, acquiring a new image file top layer, an init layer and a mount layer lower linked list of the container through a Docker API;
s3, reconstructing an init layer lower linked list to point to a new mirror image;
s4, writing the init layer lower linked list into a lower file under the layer cache directory;
s5, reconstructing a mount layer lower linked list to point to a new init layer;
and S6, entering a mount layer lower link list to a lower file under the layer cache directory.
CN201911118464.1A 2019-11-15 2019-11-15 Container mirror image replacement method Active CN110908686B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911118464.1A CN110908686B (en) 2019-11-15 2019-11-15 Container mirror image replacement method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911118464.1A CN110908686B (en) 2019-11-15 2019-11-15 Container mirror image replacement method

Publications (2)

Publication Number Publication Date
CN110908686A true CN110908686A (en) 2020-03-24
CN110908686B CN110908686B (en) 2023-08-29

Family

ID=69816881

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911118464.1A Active CN110908686B (en) 2019-11-15 2019-11-15 Container mirror image replacement method

Country Status (1)

Country Link
CN (1) CN110908686B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117369947A (en) * 2023-10-26 2024-01-09 深圳海规网络科技有限公司 Management method and management system for container mirror image

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010051955A1 (en) * 2000-03-17 2001-12-13 Wong John P. Mirror file system
CN106227579A (en) * 2016-07-12 2016-12-14 深圳市中润四方信息技术有限公司 A kind of Docker container construction method and Docker manage control station
CN109408062A (en) * 2018-11-01 2019-03-01 郑州云海信息技术有限公司 A kind of method and apparatus of automatic deployment model training environment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010051955A1 (en) * 2000-03-17 2001-12-13 Wong John P. Mirror file system
CN106227579A (en) * 2016-07-12 2016-12-14 深圳市中润四方信息技术有限公司 A kind of Docker container construction method and Docker manage control station
CN109408062A (en) * 2018-11-01 2019-03-01 郑州云海信息技术有限公司 A kind of method and apparatus of automatic deployment model training environment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
耿朋;陈伟;魏峻;: "面向Dockerfile的容器镜像构建工具" *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117369947A (en) * 2023-10-26 2024-01-09 深圳海规网络科技有限公司 Management method and management system for container mirror image

Also Published As

Publication number Publication date
CN110908686B (en) 2023-08-29

Similar Documents

Publication Publication Date Title
US20200341754A1 (en) Techniques to deploy an application as a cloud computing service
CN108279932B (en) Method and device for dynamically configuring user interface of mobile terminal
CN104461484B (en) The implementation method and device of front-end template
CN114697304B (en) Gray release method, system, device, equipment and storage medium
US11392366B1 (en) Optimized compilation of pipelines for continuous delivery of services on datacenters configured in cloud platforms
US10169302B2 (en) Method and system for page display, server-end device, client device and storage medium
US10296520B1 (en) Social network analysis of file access information
CN104750472B (en) The resource package management method and device of a kind of terminal applies
CN106406925A (en) An apparatus and a method used for supporting online upgrade
US20090210871A1 (en) System and method for software application migration
CN113220339B (en) Page generation method and device
CN114721681A (en) Configuration file updating method, device, equipment and storage medium
CN105159718A (en) Firmware updating method and device
EP3440539A1 (en) Policy driven flight management
US12450039B2 (en) Extending application lifecycle management to user-created application platform components
CN106201577A (en) A kind of method and device updating Lua file
CN110908686A (en) Container mirror image replacing method
CN101807204B (en) Dynamic creation method of processing Web service with remote sensing image
CN103713924B (en) The upgrade method and system of cloud computing platform service
CN112596734A (en) Static library generation method and device
CN101482883B (en) Method and system for on-line updating characteristic character library
CN110196883A (en) A kind of method of data synchronization and device on business on line without influence
CN117707583B (en) Page updating method, electronic device and page updating system
CN108259613B (en) Disaster recovery data online synchronization device, method and computer readable storage medium
CN113312073B (en) Installation package file processing method and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A method for replacing container images

Granted publication date: 20230829

Pledgee: Xi'an innovation financing Company limited by guarantee

Pledgor: XI'AN LEIFENG ELECTRONIC TECHNOLOGY Co.,Ltd.

Registration number: Y2024980010071