A method and system for component packaging and application construction based on Docker

Through Docker -based component packaging and application construction methods, the problem that traditional application software cannot meet the flexible and changeable needs is solved, and the flexible configuration and application dynamic construction between components have been realized, reducing operation and maintenance and development costs.

CN112181404BActive Publication Date: 2025-01-28SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011042457.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-28
Publication Date
2025-01-28
Estimated Expiration
2040-09-28

AI Technical Summary

Technical Problem

Traditional application software cannot meet the flexible and changeable needs of businesses in various fields, cannot adapt to flexible adjustments of policies and regulations, and cannot cope with the hierarchical management needs of project planning for business.

Method used

Using Docker -based component packaging and application construction methods, Docker mirror files that define components as a single function of microservices architecture, build mirrors, define basic information of registered components, and use these components for application construction.

Benefits of technology

The flexible configuration of the relationship between components has been realized, and a dynamic construction system that is flexible, fast, and reused has been built, reducing the cost of application operation and maintenance and development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112181404B_ABST
    Figure CN112181404B_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for component encapsulation and application building based on Docker, belonging to the field of container technology. The specific steps of the method are as follows: S1 Define the component as a single-function Docker image file of a microservice architecture; S2 Build the image; S3 Define the basic information of the registered component; S4 Use the registered component to assemble and build the application. This invention enables the flexible configuration of relationships between components to be readily available, and builds a flexible, fast, and more reusable dynamic application building system, providing a solution to the problems that traditional application software cannot solve.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention discloses a method and system for component packaging and application construction based on Docker, and relates to the technical field of containers. Background Art

[0002] Traditional application software adopts a decentralized construction method, which leads to the dispersion of operation and maintenance nodes. The data generated during operation is of low quality and it is difficult to form data assets.

[0003] At the same time, the business in various fields is flexible and changeable. Some application systems often need to be flexibly adjusted according to relevant policies and regulations, and project planning also needs to support the hierarchical management needs of various businesses.

[0004] Therefore, it is necessary to classify components in a refined manner, plan and intervene in advance during the component development stage, so that components have the characteristics of flexible configuration and dynamic combination, and to make the flexible configuration of the relationship between components ready-made, and to build a flexible, fast, and more reusable application dynamic construction system. Therefore, a method and system for component packaging and application construction based on Docker is invented. Summary of the invention

[0005] In view of the problems of the prior art, the present invention provides a method and system for component packaging and application construction based on Docker. The technical solution adopted is: a method for component packaging and application construction based on Docker, wherein the specific steps of the method are as follows:

[0006] S1 defines a component as a Docker image file with a single function in a microservice architecture;

[0007] S2 component mirroring;

[0008] S3 defines the basic information of the registered component;

[0009] S4 uses registered components to assemble applications.

[0010] S1 defines a component as a Docker image file with a single function, which can be packaged and reused separately and developed using microservice architecture technology. The specific steps include:

[0011] S101 uses SpringCloud architecture to uniformly develop internal programs of components;

[0012] S102 reads a component internal program configuration file from an environment variable;

[0013] S103 obtains the external interface address and external link address used by the internal program of the component from the environment variable;

[0014] The internal program of S104 component is integrated with NACOS.

[0015] The S2 uses three methods to build images: uploading image tar packages, template components, or Dockerfile.

[0016] The basic steps of defining the basic information of the S3 registration component include:

[0017] S301 determines the type of the registered component;

[0018] S302 provides external services through the RestFul interface of the composite component;

[0019] S312 uses construction components for component splicing.

[0020] The specific steps of S4 using registered components to assemble and implement application construction include:

[0021] S401 uses construction components and reusable components to complete application assembly through visual interface operations;

[0022] S402: Fill in the application related information and the value of the component environment variable;

[0023] S403 creates a new application;

[0024] S404 generates a YAML file for each component according to the dependency relationship of the components on the visual interface;

[0025] S405 completes the construction of each component container service through the kubectlcreate-fyaml file, injects the corresponding environment variables into each component, and publishes it to the container cluster for deployment and operation;

[0026] S406: Publishing the assembled application.

[0027] A system for component packaging and application construction based on Docker, the system comprising a component definition module, an image construction module, an information filling module and a component assembly module:

[0028] Component definition module: defines a component as a Docker image file with a single function in a microservice architecture;

[0029] Image building module: component image;

[0030] Information filling module: defines the basic information of the registered component;

[0031] Component assembly module: Use registered components to assemble applications.

[0032] The component definition module defines a component as a Docker image file with a single function, which can be packaged and reused separately and developed using microservice architecture technology. The component definition module specifically includes a program development module, a configuration reading module, an external communication module and an internal integration module:

[0033] Program development module: Use SpringCloud architecture to uniformly develop internal programs of components;

[0034] Configuration reading module: reads the component internal program configuration file from the environment variable;

[0035] External communication module: obtains the external interface address and external link address used by the internal program of the component from the environment variables;

[0036] Internal integration module: The internal program of the component is integrated with NACOS.

[0037] The image building module uses three methods to build images: uploading image tar packages, template components or Dockerfile.

[0038] The information filling module specifically includes a component judgment module, a first component module and a second component module:

[0039] Component judgment module: judge the type of registered component;

[0040] The first component module: provides external services for composite components through the RestFul interface;

[0041] The second component module: Use the construction components for component splicing.

[0042] The component assembly module specifically includes an assembly operation module, a variable input module, an application creation module, a file generation module, a deployment and operation module, and an application publishing module:

[0043] Assembly operation module: Use construction components and reusable components to complete application assembly through visual interface operations;

[0044] Variable input module: fill in the relevant information of the application and the value of the component environment variable;

[0045] Application creation module: create a new application;

[0046] File generation module: generates the YAML file of each component according to the dependency relationship of the components on the visual interface;

[0047] Deployment and operation module: Complete the construction of each component container service through the kubectlcreate-fyaml file, inject the corresponding environment variables into each component, and publish it to the container cluster for deployment and operation;

[0048] Application publishing module: publish the assembled applications.

[0049] The beneficial effects of the present invention are as follows: the present invention can make the flexible configuration of the relationship between components ready-made, build a flexible, fast and more reusable dynamic application construction system, and provide a solution to the final effect of the problem that traditional application software cannot solve, with:

[0050] It can customize specialized business components for commonly used application components according to the user's business scenario needs;

[0051] It can realize the reuse of components among various applications;

[0052] It can realize the rapid construction and launch of business applications;

[0053] It can realize automatic deployment and centralized deployment;

[0054] It can achieve the advantage of reducing application operation and development costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0056] Figure 1 is a flow chart of the method of the present invention; Figure 2 It is a structural schematic diagram of the system of the present invention. DETAILED DESCRIPTION

[0057] The present invention is 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 implement it, but the embodiments are not intended to limit the present invention.

[0058] Embodiment 1:

[0059] A method for component packaging and application construction based on Docker, wherein the specific steps of the method are as follows:

[0060] S1 defines a component as a Docker image file with a single function in a microservice architecture;

[0061] S2 component mirroring;

[0062] S3 defines the basic information of the registered component;

[0063] S4 uses registered components to assemble and build applications;

[0064] The method of the present invention can solve the problems that traditional application software cannot meet the flexible and changeable needs of businesses in various fields, cannot adapt to the flexible adjustment according to relevant policies and specifications, and cannot cope with the needs of project planning for hierarchical management of various businesses. The method of the present invention makes the flexible configuration of the relationship between components ready-made, constructs a flexible, fast, and more reusable application dynamic construction system, and provides a solution to the final effect of the problems that traditional application software cannot solve.

[0065] It has the following advantages:

[0066] It can customize specialized business components for commonly used application components according to the user's business scenario needs;

[0067] It can realize the reuse of components among various applications;

[0068] It can realize the rapid construction and launch of business applications;

[0069] It can realize automatic deployment and centralized deployment;

[0070] It can reduce application operation and development costs;

[0071] Furthermore, S1 defines the component as a Docker image file with a single function, capable of being individually packaged and reused, and developed using microservice architecture technology. The specific steps include:

[0072] S101 uses SpringCloud architecture to uniformly develop internal programs of components;

[0073] S102 reads a component internal program configuration file from an environment variable;

[0074] S103 obtains the external interface address and external link address used by the internal program of the component from the environment variable;

[0075] S104 component internal program integration NACOS;

[0076] The Docker image files developed at the same time do not support pure front-end programs;

[0077] Furthermore, the S2 uses three methods to build the image: uploading the image tar package, template component or Dockerfile;

[0078] The image upload method refers to directly uploading the hard-packed image tar package to build the corresponding image; the template construction method refers to directly uploading the image war package to build the corresponding image based on the existing basic image; the Dockerfile construction method refers to directly using the self-written Dockerfile file and the corresponding construction file attachments to build the corresponding image; At the same time, it should be noted that in order to maintain the smooth operation of all container services and improve the operation efficiency of the services, the maximum size of the image tar package and file cannot exceed 500M;

[0079] Furthermore, the basic steps of defining the basic information of the registered component in S3 include:

[0080] S301 determines the type of the registered component;

[0081] S302 provides external services through the RestFul interface of the composite component;

[0082] S312 uses construction components for component splicing;

[0083] When registering a component, it is necessary to define the basic information of the component, including the image URL, version number, number of ports of required containers, mapping relationships, upper and lower limits of required hardware resources, etc. First, determine whether the type of the registered component is a reusable component or a construction component according to S301. When it is determined to be a reusable component, the component can meet the reuse of a single function, service, etc., that is, provide services to the outside world through the RestFul interface according to S302. Among reusable components, they can be roughly divided into middleware components, basic components, and business components according to their usage scenarios. Among them, middleware components and some basic components provide native components for developers to use, and business components are developed by developers in accordance with the technical requirements of platform development specifications;

[0084] When it is determined to be a construction component, it means a component used in the application construction function in accordance with the platform construction component development technical specifications and construction component development requirements, and is used to build an application system. This type of component is developed to meet the platform's flexible construction requirements for application systems. During development, the component's external dependencies and dependencies must be fully exposed, and it can be spliced ​​with other components in accordance with S312;

[0085] Furthermore, the specific steps of S4 using registered components to assemble and implement application construction include:

[0086] S401 uses construction components and reusable components to complete application assembly through visual interface operations;

[0087] S402: Fill in the application related information and the value of the component environment variable;

[0088] S403 creates a new application;

[0089] S404 generates a YAML file for each component according to the dependency relationship of the components on the visual interface;

[0090] S405 completes the construction of each component container service through the kubectlcreate-fyaml file, injects the corresponding environment variables into each component, and publishes it to the container cluster for deployment and operation;

[0091] S406: Publishing the assembled application;

[0092] When the registered components are assembled to realize the application components according to S4, firstly, the construction components and the conforming components are used to complete the flexible assembly of the application through the visual interface operation according to S401, and then the key information of the new application and the values ​​of the environment variables that need to be changed for each component are filled in according to S402. After the interface operation is completed, the system background program creates a new application according to S403. In the created new application, the YAML file of each component is generated according to the dependency relationship of the components on the interface according to S404, and then the container service of each component is built through the kubectlcreate-fyaml file according to S405, and the corresponding environment variables are injected into each component, and the application is published to the container cluster for deployment and operation. At the same time, the assembled application is published with one click according to S406 for other users to apply for use.

[0093] Embodiment 2:

[0094] A system for component packaging and application construction based on Docker, the system comprising a component definition module, an image construction module, an information filling module and a component assembly module:

[0095] Component definition module: defines a component as a Docker image file with a single function in a microservice architecture;

[0096] Image building module: component image;

[0097] Information filling module: defines the basic information of the registered component;

[0098] Component assembly module: assemble registered components to build applications;

[0099] The system method of the present invention can solve the problems that traditional application software cannot meet the flexible and changeable business needs in various fields, cannot adapt to the flexible adjustment according to relevant policies and specifications, and cannot cope with the needs of project planning for hierarchical management of various businesses. The system of the present invention makes the flexible configuration of the relationship between components ready-made, and constructs a flexible, fast, and more reusable application dynamic construction system, which provides a solution to the final effect of the problems that traditional application software cannot solve.

[0100] It has the following advantages:

[0101] It can customize specialized business components for commonly used application components according to the user's business scenario needs;

[0102] It can realize the reuse of components among various applications;

[0103] It can realize the rapid construction and launch of business applications;

[0104] It can realize automatic deployment and centralized deployment;

[0105] It can reduce application operation and development costs;

[0106] The component definition module defines a component as a Docker image file with a single function, which can be packaged and reused separately and developed using microservice architecture technology. The component definition module specifically includes a program development module, a configuration reading module, an external communication module and an internal integration module:

[0107] Program development module: Use SpringCloud architecture to uniformly develop internal programs of components;

[0108] Configuration reading module: reads the component internal program configuration file from the environment variable;

[0109] External communication module: obtains the external interface address and external link address used by the internal program of the component from the environment variables;

[0110] Internal integration module: NACOS is integrated into the internal program of the component;

[0111] The Docker image files developed at the same time do not support pure front-end programs;

[0112] Furthermore, the image building module uses three methods to build the image: uploading the image tar package, template component or Dockerfile;

[0113] The image upload method refers to directly uploading the hard-packed image tar package to build the corresponding image; the template construction method refers to directly uploading the image war package to build the corresponding image based on the existing basic image; the Dockerfile construction method refers to directly using the self-written Dockerfile file and the corresponding construction file attachments to build the corresponding image; At the same time, it should be noted that in order to maintain the smooth operation of all container services and improve the operation efficiency of the services, the maximum size of the image tar package and file cannot exceed 500M;

[0114] Furthermore, the information filling module specifically includes a component judgment module, a first component module and a second component module:

[0115] Component judgment module: judge the type of registered component;

[0116] The first component module: provides external services for composite components through the RestFul interface;

[0117] The second component module: using the construction components for component splicing;

[0118] When registering a component, it is necessary to define the basic information of the component, including the image URL, version number, number of ports required for containers, mapping relationships, upper and lower limits of required hardware resources, etc. First, the component judgment module is used to determine whether the type of the registered component is a reusable component or a construction component. When it is determined to be a reusable component, the component can meet the reuse of a single function, service, etc., that is, it uses the first component module to provide services to the outside world through the RestFul interface. Among reusable components, they can be roughly divided into middleware components, basic components, and business components according to their usage scenarios. Among them, middleware components and some basic components provide native components for developers to use, and business components are developed by developers in accordance with the technical requirements of platform development specifications;

[0119] When it is determined to be a construction component, it means a component used in the application construction function in accordance with the platform construction component development technical specifications and construction component development requirements, and is used to build an application system. This type of component is developed to meet the platform's flexible construction requirements for application systems. During development, the component's external dependencies and dependencies must be fully exposed, and the second component module must be used for splicing with other components;

[0120] Furthermore, the component assembly module specifically includes an assembly operation module, a variable input module, an application creation module, a file generation module, a deployment and operation module, and an application publishing module:

[0121] Assembly operation module: Use construction components and reusable components to complete application assembly through visual interface operations;

[0122] Variable input module: fill in the relevant information of the application and the value of the component environment variable;

[0123] Application creation module: create a new application;

[0124] File generation module: generates the YAML file of each component according to the dependency relationship of the components on the visual interface;

[0125] Deployment and operation module: Complete the construction of each component container service through the kubectlcreate-fyaml file, inject the corresponding environment variables into each component, and publish it to the container cluster for deployment and operation;

[0126] Application publishing module: S406 publishes the assembled application;

[0127] When the component assembly module uses registered components to assemble application components, the assembly operation module first uses the construction components and the conforming components to complete the flexible assembly of the application through the visual interface operation, and then uses the variable input module to fill in the key information of the new application and the values ​​of the environment variables that need to be changed for each component. After the interface operation is completed, the system background program creates a new application through the application creation module. In the created new application, the file generation module is used to generate the YAML file of each component according to the dependency relationship of the components on the interface. Then, the deployment and operation module is used to complete the construction of each component container service through the kubectlcreate-fyaml file, inject the corresponding environment variables into each component, and publish it to the container cluster for deployment and operation. At the same time, according to S406, the assembled application is published with one click for other users to apply for use.

[0128] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for component packaging and application construction based on Docker, characterized by The specific steps of the method are as follows: S1 defines a component as a Docker image file with a single function in a microservice architecture; S2 builds the image; S3 defines the basic information of the registered component; S4 uses registered components to assemble and build applications; S1 defines a component as a Docker image file with a single function, which can be packaged and reused separately and developed using microservice architecture technology. The specific steps include: S101 uses SpringCloud architecture to uniformly develop internal programs of components; S102 reads a component internal program configuration file from an environment variable; S103 obtains the external interface address and external link address used by the internal program of the component from the environment variable; S104 component internal program integration NACOS; The S2 uses three methods to build the image: uploading the image tar package, template component or Dockerfile; the basic steps of defining the basic information of the registered component in S3 include: S301 determines the type of the registered component; S302 provides external services through the RestFul interface of the composite component; S312 uses construction components for component splicing; The specific steps of S4 using registered components to assemble and implement application construction include: S401 uses construction components and reusable components to complete application assembly through visual interface operations; S402: Fill in the application related information and the value of the component environment variable; S403 creates a new application; S404 generates a YAML file for each component according to the dependency relationship of the components on the visual interface; S405 completes the construction of each component container service through the kubectlcreate-fyaml file, injects the corresponding environment variables into each component, and publishes it to the container cluster for deployment and operation; S406: Publishing the assembled application.

2. A system for component packaging and application construction based on Docker, characterized by The system includes a component definition module, an image building module, an information filling module and a component assembly module: Component definition module: defines a component as a Docker image file with a single function in a microservice architecture; Image building module: builds the image; Information filling module: defines the basic information of the registered component; Component assembly module: assemble registered components to build applications; The component definition module defines a component as a Docker image file with a single function, which can be packaged and reused separately and developed using microservice architecture technology. The component definition module specifically includes a program development module, a configuration reading module, an external communication module and an internal integration module: Program development module: Use SpringCloud architecture to uniformly develop internal programs of components; Configuration reading module: reads the component internal program configuration file from the environment variable; External communication module: obtains the external interface address and external link address used by the internal program of the component from the environment variables; Internal integration module: NACOS is integrated into the internal program of the component; The image building module builds the image using three methods: uploading the image tar package, template component or Dockerfile; The information filling module specifically includes a component judgment module, a first component module and a second component module: Component judgment module: judge the type of registered component; The first component module: provides external services for composite components through the RestFul interface; The second component module: using the construction components for component splicing; The component assembly module specifically includes an assembly operation module, a variable input module, an application creation module, a file generation module, a deployment and operation module, and an application publishing module: Assembly operation module: Use construction components and reusable components to complete application assembly through visual interface operations; Variable input module: fill in the relevant information of the application and the value of the component environment variable; Application creation module: create a new application; File generation module: generates the YAML file of each component according to the dependency relationship of the components on the visual interface; Deployment and operation module: Complete the construction of each component container service through the kubectlcreate-fyaml file, inject the corresponding environment variables into each component, and publish it to the container cluster for deployment and operation; Application publishing module: publish the assembled applications.

Citation Information

Patent Citations

  • Docker container construction method and device, equipment and storage medium

    CN110058863A

  • Micro-service application platform and resource storage method and storage device thereof

    CN111008177A