Method for automatically updating container application triggered by container mirror image

By listening to container image update events and automatically updating container applications according to preset rules, the problem of manual operation of container application updates in the prior art is solved, and the automatic update of container applications is realized, which significantly improves update efficiency and stability.

CN120215997APending Publication Date: 2025-06-27SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510215881.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-26
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

In the prior art, container application updates require manual operation, which leads to time-consuming and labor-consuming, prone to parameter configuration errors, increases the risk of production failures, and causes unnecessary losses to the enterprise.

Method used

By listening to the update event of the container image, and automatically update the container applications using the image on all clusters according to the preset trigger rules, realizing automatic updates of container applications.

Benefits of technology

It significantly reduces the workload of developers, improves the efficiency of container application updates, reduces the risk of manual operation errors, and ensures the continuous stability and business continuity of container applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120215997A_ABST
    Figure CN120215997A_ABST
Patent Text Reader

Abstract

The invention discloses a method for automatically updating a container application triggered by a container mirror image, and relates to the technical field of cloud edge computing. Comprising the following steps of: 1, constructing a container mirror image by using a Devps tool or a Docufile, 2, creating a container arrangement template by using a container arrangement engine, and deploying a container application into a container cluster according to the container mirror image, and 3, adding a trigger to the container mirror image, and triggering the container application to be automatically updated through the trigger when the container mirror image has a new version according to a trigger condition; and 4, monitoring a mirror image pushing event, obtaining a mirror image name, a version number, an affiliated item, a version release strategy and information of an affiliated user according to the mirror image pushing event, and executing container application updating according to a triggering condition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention discloses a method for automatically updating container applications triggered by container images, which relates to the technical field of cloud-edge computing. Background Art

[0002] In the current era of cloud computing, with the rapid development of cloud computing technology, especially the wide application of container technology, more and more industries and enterprises choose to migrate their business systems to the cloud platform for deployment and operation. The cloud platform, with its advantages such as high availability, elastic scalability, and cost-effectiveness, has become an important driving force for promoting business innovation and technological upgrading.

[0003] However, after migrating the business to the cloud, in order to meet user needs and enhance product competitiveness, the developer team needs to continuously iterate and upgrade the software. When it comes to the update problem of container applications, under the existing manual operation mode, the operation and maintenance engineer team needs to execute a series of complex steps to update the container applications. This operation mode not only consumes time and effort but also is extremely prone to parameter configuration errors, resulting in production failures and bringing unnecessary losses to the enterprise. Summary of the Invention

[0004] Aiming at the problems of the prior art, the present invention provides a method for automatically updating container applications triggered by container images. By listening to image update events and according to pre-set trigger rules, it automatically updates all container applications using the image on all clusters, realizing the automatic update of container applications, solving the problem of high error rate in manually updating container applications, significantly reducing the workload of developers, and improving the update efficiency of container applications.

[0005] The specific solution proposed by the present invention is as follows:

[0006] The present invention provides a method for automatically updating container applications triggered by container images, including:

[0007] Step 1: Build a container image using a Devops tool or a Docfile file.

[0008] Step 2: Create a container orchestration template using a container orchestration engine, and deploy the container application to the container cluster according to the container image.

[0009] Step 3: Add a trigger to the container image. When there is a new version of the container image, the trigger automatically updates the container application according to the trigger condition:

[0010] When a new version of the container image is generated, or when the version number of the container image remains unchanged but the image content changes and is re-pushed, if the trigger condition is full trigger, then all container applications are triggered to be automatically updated.

[0011] When the specified container image version is generated or updated, and the trigger condition is triggered by the specified version number, the corresponding container application is automatically updated.

[0012] When a container image version that matches a regular expression is generated or updated, and the trigger condition is regular expression trigger, the corresponding container application is automatically updated.

[0013] Step 4: Listen for the image push event. Based on the image push event, obtain information such as the image name, version number, project it belongs to, version release strategy, and the user it belongs to, and execute the container application update according to the trigger condition.

[0014] Furthermore, when building a container image using a Docfile file in step 1 of the method for automatically updating a container application triggered by a container image, instructions and configurations required for building the container image are specified, including the base image of the container image, added files, exposed ports, and running commands. The instructions required for building the container image are executed sequentially, and finally a runnable container image is generated.

[0015] Furthermore, in step 2 of the method for automatically updating a container application triggered by a container image, a container orchestration template is created using the Kubernetes container orchestration engine. The architecture, resource allocation, and network configuration of the container cluster for defining and managing the container orchestration template are utilized with the Kubernetes container orchestration engine.

[0016] The command-line tool or graphical interface of the Kubernetes container orchestration engine is used to trigger the deployment process. The Kubernetes container orchestration engine automatically creates and manages container instances in the container cluster according to the definitions in the container orchestration template.

[0017] Furthermore, in step 4 of the method for automatically updating a container application triggered by a container image, based on the information such as the image name, version number, project it belongs to, version release strategy, and the user it belongs to, the container application instances using the container image are searched, and the corresponding version of the container application is automatically updated according to the trigger condition.

[0018] The present invention also provides a device for automatically updating a container application triggered by a container image, including an image production module, a template management module, a trigger management module, a module for listening for image push events, and an automatic update module.

[0019] The image production module builds a container image using Devops tools or a Docfile file.

[0020] The template management module creates a container orchestration template using the container orchestration engine and deploys the container application to the container cluster according to the container image.

[0021] The trigger management module adds triggers to container images. When a new version of the container image is available, the container application is automatically updated according to the trigger conditions:

[0022] When a new container image version is generated, or the container image version number remains unchanged but the image content changes and is pushed again, if the trigger condition is all triggered, all container applications will be automatically updated.

[0023] When the specified container image version is generated or updated, the trigger condition is triggered by the specified version number, which triggers the automatic update of the corresponding container application.

[0024] When a container image version that matches the regular expression is generated or updated, the trigger condition is a regular trigger, which triggers the corresponding container application to be automatically updated;

[0025] The image push event monitoring module monitors the image push event. The automatic update module obtains the image name, version number, project, version release strategy and user information according to the image push event, and executes the container application update according to the trigger conditions.

[0026] Furthermore, when the image production module of the container image triggering container application automatic update device uses a Docfile file to build a container image, it builds the instructions and configurations required for the container image, and specifies the base image of the container image, added files, exposed ports and run commands, and sequentially executes the instructions required to build the container image, and finally generates an executable container image.

[0027] Furthermore, the template management module of the container image triggering container application automatic update device uses the Kubernetes container orchestration engine to create a container orchestration template, wherein the Kubernetes container orchestration engine is used to define and manage the architecture, resource allocation and network configuration of the container cluster of the container orchestration template.

[0028] Use the command line tool or graphical interface of the Kubernetes container orchestration engine to trigger the deployment process, and use the Kubernetes container orchestration engine to automatically create and manage container instances in the container cluster according to the definition in the container orchestration template.

[0029] Furthermore, the automatic update module of the container image-triggered container application automatic update device searches for a container application instance using the container image based on the image name, version number, project, version release policy, and user information, and executes the automatic update of the corresponding version of the container application according to the triggering conditions.

[0030] The benefits of the present invention are:

[0031] By presetting the mirror trigger strategy, there is no need to manually modify the versions of relevant container application instances during the container application update process, preventing errors during the manual operation of the operation and maintenance personnel, reducing the risk of manual operation of the operation and maintenance personnel, significantly reducing the workload of developers, and improving the container application update efficiency. Brief Description of the Drawings

[0032] Figure 1 It is a schematic diagram of the application framework of the present invention. Detailed Embodiments

[0033] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, so that those skilled in the art can better understand the present invention and be able to implement it, but the embodiments cited do not limit the present invention.

[0034] Embodiment 1

[0035] The present invention provides a method for automatically updating a container application triggered by a container image, including:

[0036] Step 1: Use a Devops tool or a Docfile file to build a container image.

[0037] When using a Docfile file to build a container image, the instructions and configurations required for building the container image are specified, and the base image of the container image, added files, exposed ports, and running commands are specified, and the instructions required for building the container image are executed sequentially, and finally a runnable container image is generated.

[0038] The construction of the container image ensures the consistency and portability of the software in different environments. Through the automated construction process, developers can save a large amount of time and effort, reduce the risk of human errors and failures, and thus deliver high-quality software products more efficiently.

[0039] A version control system, such as Git, can also be used to manage code changes and create corresponding version tags. This tag will be used to identify and track specific versions of the code, ensuring the consistency and traceability of subsequent builds and deployments.

[0040] Step 2: Use a container orchestration engine to create a container orchestration template, and deploy the container application to the container cluster according to the container image.

[0041] Among them, use the Kubernetes container orchestration engine to create a container orchestration template, and use the Kubernetes container orchestration engine to define and manage the architecture, resource allocation, and network configuration of the container cluster of the container orchestration template.

[0042] Trigger the deployment process using the command-line tool or graphical interface of the Kubernetes container orchestration engine. Use the Kubernetes container orchestration engine to automatically create and manage container instances in the container cluster according to the definitions in the container orchestration template. This process includes pulling the specified container image from the image repository, allocating resources in the cluster, starting the container instances, configuring the network and storage, etc. By using the container orchestration engine and the container orchestration template, developers can greatly simplify the deployment process of container applications and reduce the workload of manual configuration and management.

[0043] Step 3: Add a trigger to the container image. When a new version of the container image is available according to the trigger condition, trigger the automatic update of the container application:

[0044] When a new container image version is generated, or when the container image version number remains unchanged but the image content changes and is repushed, if the trigger condition is full trigger, then all trigger the automatic update of the container application.

[0045] When a specified container image version is generated or updated, if the trigger condition is specified version number trigger, then trigger the corresponding container application to be automatically updated.

[0046] For example, you can filter the version tags that need to be triggered in the list. Only when the version Tag is in the list will the trigger be triggered after the image is built; otherwise, it is in an untriggered state.

[0047] The supported version policy rules are as follows:

[0048] (1) Version tags of the major version number (Major), minor version number (Minor), and patch version number (Patch) type:

[0049] Each part is an integer greater than or equal to zero (>=0) and changes according to the increasing rule. Support =, <, <=, >, >=, *, ~, ^.

[0050] (2) Version tags of the timestamp yyyyMMdd_HHmmss type:

[0051] Support =, <, <=, >, >=.

[0052] (3) Other version tags that do not conform to the above (1) and (2) rules only support =.

[0053] You can refer to Table 1

[0054] Table 1

[0055]

[0056]

[0057] When a container image version that matches the regular expression is generated or updated, and the trigger condition is a regular trigger, the corresponding container application is automatically updated. The regular expression rules are as follows:

[0058] *: Matches any field that does not contain the path separator " / ".

[0059] **: Matches any field that contains the path separator " / ".

[0060] ?: Matches any single character other than " / ".

[0061] {option1, option2,...}: Matches multiple options simultaneously.

[0062] Step 4: After the image is built through the Devops tool or Dockerfile, push the image file to the image repository. After the push is completed, an image push event is automatically generated. Listen for the image push event. When the image push event is detected, obtain relevant information such as the corresponding image name, version number, project it belongs to, version release strategy, and user it belongs to according to the image push event, and record the data in the database image event table.

[0063] Listen for the image push event. According to the image push event, obtain the information of the image name, version number, project it belongs to, version release strategy, and user it belongs to. According to the information of the image name, version number, project it belongs to, version release strategy, and user it belongs to, find the container application instances that use the container image, and execute the automatic update of the corresponding version of the container application according to the trigger condition. Update the container image version used by the application instance.

[0064] The method of the present invention reduces the risk of manual operations, improves the update efficiency of container applications, and can achieve continuous integration, continuous delivery, and automatic update of container applications. It can greatly simplify the update process, reduce human errors, increase the update speed, and thus ensure the continuity and stability of the business. At the same time, automatic update can also help enterprises better respond to the rapidly changing market environment, enhance the competitiveness of products and user experience.

[0065] Embodiment 2

[0066] The present invention also provides a device for automatically updating a container application triggered by a container image, including an image production module, a template management module, a trigger management module, a module for listening for image push events, and an automatic update module.

[0067] The image production module uses the Devops tool or Docfile file to build a container image.

[0068] The template management module creates a container orchestration template using a container orchestration engine and deploys the container application to the container cluster according to the container image.

[0069] The trigger management module adds a trigger to the container image. When a new version of the container image is available according to the trigger condition, the trigger automatically updates the container application:

[0070] When a new container image version is generated, or when the container image version number remains unchanged but the image content changes and is repushed, if the trigger condition is full trigger, then all container applications are automatically updated.

[0071] When a specified container image version is generated or updated, if the trigger condition is specified version number trigger, then the corresponding container application is automatically updated.

[0072] When a container image version that matches a regular expression is generated or updated, if the trigger condition is regular trigger, then the corresponding container application is automatically updated;

[0073] The module for listening to image push events listens to image push events. The automatic update module obtains information such as the image name, version number, project it belongs to, version release strategy, and the user it belongs to based on the image push event, and executes the container application update according to the trigger condition.

[0074] Regarding the information interaction and execution process among the above-mentioned device modules, since they are based on the same concept as the method embodiments of the present invention, the specific content can be referred to the description in the method embodiments of the present invention and will not be elaborated here.

[0075] Similarly, by presetting the image trigger strategy in the device of the present invention, there is no need to manually modify the versions of relevant container application instances during the container application update process, preventing errors during the manual operation of the operation and maintenance personnel, reducing the risk of manual operation by the operation and maintenance personnel, significantly reducing the workload of developers, and improving the container application update efficiency.

[0076] It should be noted that not all steps and modules in the above-mentioned processes and device structures are necessary, and some steps or modules can be ignored according to actual needs. The execution order of each step is not fixed and can be adjusted according to needs. The system structures described in the above embodiments can be physical structures or logical structures, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or some components in multiple independent devices may be jointly implemented.

[0077] The above-described embodiments are merely preferred embodiments cited to fully illustrate the present invention, and the protection scope of the present invention is not limited thereto. Equivalent substitutions or transformations made by those skilled in the art on the basis of the present invention are all within the protection scope of the present invention. The protection scope of the present invention shall be subject to the claims.

Claims

1. A method for automatically updating a container application triggered by a container image, characterized in that include: Step 1: Use DevOps tools or Docfile to build a container image. Step 2: Use the container orchestration engine to create a container orchestration template and deploy the container application to the container cluster based on the container image. Step 3: Add a trigger for the container image. When a new version of the container image is available, the container application is automatically updated according to the trigger conditions: When a new container image version is generated, or the container image version number remains unchanged but the image content changes and is pushed again, if the trigger condition is all triggered, all container applications will be automatically updated. When the specified container image version is generated or updated, the trigger condition is triggered by the specified version number, which triggers the automatic update of the corresponding container application. When a container image version that matches the regular expression is generated or updated, the trigger condition is a regular trigger, which triggers the corresponding container application to be automatically updated; Step 4: Listen to the image push event, obtain the image name, version number, project, version release strategy and user information according to the image push event, and execute the container application update according to the trigger conditions.

2. According to claim 1, a container image triggering container application automatic update method is characterized in that when using the Docfile file to build the container image in step 1, the instructions and configuration required for building the container image are constructed, and the base image of the container image, the added files, the exposed ports and the running commands are specified, and the instructions required for building the container image are executed sequentially to finally generate an executable container image.

3. According to claim 1, a method for automatically updating container applications triggered by a container image is characterized in that In step 2, the Kubernetes container orchestration engine is used to create a container orchestration template, in which the Kubernetes container orchestration engine is used to define and manage the architecture, resource allocation, and network configuration of the container cluster of the container orchestration template. Use the command line tool or graphical interface of the Kubernetes container orchestration engine to trigger the deployment process, and use the Kubernetes container orchestration engine to automatically create and manage container instances in the container cluster according to the definition in the container orchestration template.

4. According to the method of triggering automatic update of container application by container image according to claim 1, it is characterized in that in step 4, the container application instance using the container image is searched according to the image name, version number, project to which it belongs, version release policy and information of the user to which it belongs, and the automatic update of the container application of the corresponding version is executed according to the triggering conditions.

5. A container image triggers a container application automatic update device, characterized in that It includes image creation module, template management module, trigger management module, image push event monitoring module and automatic update module. The image creation module uses Devops tools or Docfile files to build container images. The template management module uses the container orchestration engine to create container orchestration templates and deploy container applications to container clusters based on container images. The trigger management module adds triggers to container images. When a new version of the container image is available, the container application is automatically updated according to the trigger conditions: When a new container image version is generated, or the container image version number remains unchanged but the image content changes and is pushed again, if the trigger condition is all triggered, all container applications will be automatically updated. When the specified container image version is generated or updated, the trigger condition is triggered by the specified version number, which triggers the automatic update of the corresponding container application. When a container image version that matches the regular expression is generated or updated, the trigger condition is a regular trigger, which triggers the corresponding container application to be automatically updated; The image push event monitoring module monitors the image push event. The automatic update module obtains the image name, version number, project, version release strategy and user information according to the image push event, and executes the container application update according to the trigger conditions.

6. The container image triggering container application automatic update device according to claim 5, characterized in that the image When the production module uses the Docfile file to build a container image, it builds the instructions and configurations required for the container image, specifies the base image of the container image, added files, exposed ports, and run commands, and sequentially executes the instructions required to build the container image to finally generate an executable container image.

7. The container image triggering container application automatic update device according to claim 5, characterized in that The template management module uses the Kubernetes container orchestration engine to create container orchestration templates, which use the Kubernetes container orchestration engine to define and manage the architecture, resource allocation, and network configuration of the container cluster of the container orchestration template. Use the command line tool or graphical interface of the Kubernetes container orchestration engine to trigger the deployment process, and use the Kubernetes container orchestration engine to automatically create and manage container instances in the container cluster according to the definition in the container orchestration template.

8. The container image triggering container application automatic update device according to claim 5, characterized in that The automatic update module searches for container application instances that use container images based on the image name, version number, project, version release strategy, and user information, and executes automatic updates of the corresponding version of the container application according to the trigger conditions.