Docker container management method, electronic equipment and storage medium
By operating on preset APIs, dynamically generating docker container configuration files and managing container configurations, the problem of cumbersomeness and inefficiency of Docker APIs when managing multiple containers is solved, and more efficient automated deployment and management is achieved.
Patent Information
- Application Number
- CN202411917979.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-25
AI Technical Summary
Existing Docker APIs are cumbersome and inefficient in managing multiple containers, especially with limitations in automated deployment and management.
By performing the first preset operation and the second preset processing on the preset API, the first preset API and the second preset API are obtained, the docker container configuration file is dynamically generated, and the container configuration file is managed through the programming interface to ensure that the container configuration in different environments is consistent.
It improves the convenience and stability of automated deployment and management of container applications, simplifies the management process of multi-container applications, reduces manual intervention, and improves deployment efficiency and stability.
Smart Images

Figure CN119883505A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information technology, and in particular to a docker container management method, an electronic device, and a storage medium. Background Art
[0002] At present, container technology has become an important part of cloud computing and microservice architecture. As the basis of container technology, Docker API provides an interface for interacting with the Docker container engine, allowing users to manage the life cycle of a single container. Docker API can realize functions such as creating, starting, stopping, and deleting containers, which provides great convenience for containerized applications. However, as the complexity of applications increases, the number of containers that need to be managed also increases. In this case, it becomes cumbersome and inefficient to manage multiple containers using Docker API alone. To solve this problem, Docker Compose came into being. Docker Compose allows users to define application services for multiple containers through a configuration file, and then start, stop, and rebuild these services through command line tools. Although Docker Compose simplifies the management of multi-container applications, it still relies on command line tools and lacks a unified and easy-to-integrate programming interface, which leads to certain limitations in the automated deployment and management of containers. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a Docker container management method, an electronic device, and a storage medium, which can provide a higher level of abstraction through a programming interface to improve the convenience and stability of automated deployment and management of container applications.
[0004] In order to achieve the above objectives, the present application embodiment adopts the following technical solutions: In a first aspect, an embodiment of the present application provides a Docker container management method, including: Perform a first preset operation on the preset API to obtain the first preset API, and generate a docker container configuration file according to the first preset API; Perform a second preset processing on the first preset API to obtain a second preset API, and generate a docker container configuration file according to the second preset API; The docker container configuration file is managed through the first preset API and / or the second preset API to make the docker container configurations in different environments consistent.
[0005] In one implementation, performing a first preset operation on a preset API to obtain the first preset API includes: The processing logic of the preset API is extended, the database schema of the preset API is updated, and the document of the preset API is updated to provide new functions and endpoints for the preset API to obtain a first preset API.
[0006] In one embodiment, a docker container configuration file is dynamically generated according to a first preset API, including: creating a variable file containing target environment variables; obtaining a template file of a pre-stored docker container configuration file, and replacing the container name and image tag of the corresponding environment variables in the template file with the target environment variable values in the variable file through the first preset API to obtain the docker container configuration file.
[0007] In one embodiment, performing a second preset processing on the first preset API to obtain the second preset API includes: automatically containerizing and deploying the first preset API through an integrated webhook, continuous integration, and continuous delivery process to obtain the second preset API.
[0008] In one embodiment, generating a docker container configuration file according to a second preset API includes: In response to detecting a code change in a remote repository, triggering a continuous integration and / or continuous delivery process via a webhook deployed in a second preset API; Read the changed code information through the continuous integration process and / or the continuous delivery process, and generate a new image based on the changed code information; The file used to store environment variables is modified according to the service name corresponding to the changed code and the image tag of the newly generated image as input parameters to obtain the Docker container configuration file.
[0009] In one embodiment, after generating the docker container configuration file, the method further includes: The generated docker container configuration file snapshot is stored, and a code corresponding to the docker container configuration file is generated, so that the first preset API performs version control on the docker container configuration file according to the code.
[0010] In one embodiment, managing the docker container configuration file through the first preset API and / or the second preset API includes: Use placeholders to define dynamic variables in the Docker container configuration file, and set default values for dynamic variables in the file used to store environment variables; In response to the first preset API and / or the second preset API being called, parsing the input parameters used to call the first preset API or the second preset API, and identifying the variable names and corresponding variable values in the input parameters; Use the variable name and corresponding variable value in the passed parameter to replace the variable value of the same variable in the file used to store environment variables; After completing the variable replacement, reload the Docker container configuration file to ensure that the Docker container configuration file uses the updated variable value.
[0011] In one embodiment, the docker container management method further includes: Login permissions are set for the first preset API and the second preset API, and the first preset API and / or the second preset API are called through a preset authorization code.
[0012] In a second aspect, the present application provides an electronic device, comprising: a processor; a memory for storing processor executable instructions; wherein the processor is configured to execute instructions to implement the steps of the docker container management method as described in any one of the first aspects.
[0013] In a third aspect, the present application provides a computer-readable storage medium. When the instructions in the computer-readable storage medium are executed by a processor, the steps of the Docker container management method as described in any one of the first aspects are implemented.
[0014] The docker container management method, electronic device and storage medium provided in the present application, the method includes: performing a first preset operation on a preset API to obtain a first preset API, and generating a docker container configuration file according to the first preset API; performing a second preset operation on the first preset API to obtain a second preset API, and generating a docker container configuration file according to the second preset API; managing the docker container configuration file through the first preset API and / or the second preset API to make the docker container configurations in different environments consistent. Therefore, the docker container management method, electronic device and storage medium provided in the present application, by operating the preset API, obtain the first preset API and the second preset API, generate the docker container configuration file according to the first preset API and the second preset API, and manage the docker container configuration file to make the docker container configurations in different environments consistent. In this way, a higher level of abstraction can be provided through the programming interface, improving the convenience and stability of automated deployment and management of container applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings: Figure 1A flowchart of a Docker container management method provided for one embodiment of the present application; Figure 2 A schematic diagram of the structure of an electronic device provided for one embodiment of the present application. DETAILED DESCRIPTION
[0016] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0017] The terms "first", "second", etc. in this specification and claims are used to distinguish similar objects, and are not used to describe a particular order or precedence. It should be understood that the terms used in this way can be interchanged where appropriate so that the embodiments of the present application are implemented in a sequence other than those illustrated or described herein. In addition, "and / or" in this specification and claims means at least one of the connected objects, and the character " / " generally means that the objects associated with each other are in an "or" relationship.
[0018] See also Figure 1 , is a flow chart of a docker container management method provided in an embodiment of the present application. The docker container management method can be executed by an electronic device provided in an embodiment of the present application. The electronic device can be implemented in software and / or hardware, such as a server or a computer. In this embodiment, the execution subject of the docker container management method is a computer processor as an example. The docker container management method provided in this embodiment includes: Step S1, performing a first preset operation on a preset API to obtain a first preset API, and generating a docker container configuration file according to the first preset API.
[0019] In this embodiment, API (Application Programming Interface, API) is the application programming interface, and the docker container configuration file is the docker-compose.yml file. The docker-compose.yml file is an important configuration file used by the Docker Compose tool to define and run multi-container docker applications. It uses the YAML format to declare the configuration information of the application's services, networks, volumes, etc.
[0020] In one embodiment, a first preset operation is performed on a preset API to obtain a first preset API, including: expanding the processing logic of the preset API, updating the database model of the preset API and updating the documentation of the preset API, providing new functions and endpoints for the preset API to obtain the first preset API.
[0021] Specifically, performing the first preset operation on the preset API requires considering specific task requirements, writing new code according to the task requirements, adjusting or reconstructing the processing logic of the preset API (existing API), and introducing new modules or classes in the preset API so as to integrate the new processing logic into the existing architecture. Due to the adjustment or reconstruction of the processing logic, it is necessary to add new tables or update the structure of existing tables in the preset API to store new data structures, and create new indexes on the database tables as required to improve query efficiency. Update the documentation of the preset API, that is, write or update the API specification, and ensure that the API documentation reflects the latest status of the API, including newly added endpoints and functions. The new endpoint can be to access new functions by defining new URL paths and HTTP methods. Therefore, the first preset API obtained through the above operations can meet a wider range of needs and provide richer services.
[0022] In one embodiment, a docker container configuration file is dynamically generated according to a first preset API, including: creating a variable file containing target environment variables; obtaining a template file of a pre-stored docker container configuration file, and replacing the container name and image tag of the corresponding environment variables in the template file with the target environment variable values in the variable file through the first preset API to obtain the docker container configuration file.
[0023] Here, the variable file is a file in .env format, which is used to configure the environment dependencies of the application so that the application can use different settings in different operating environments. As the variable source for generating docker container configuration files, variable files are used to replace placeholders in template files to ensure that the generated configuration files are suitable for specific environments and dynamically change according to different deployment requirements, which improves the flexibility and reusability of the configuration. The template file is a docker container configuration file containing placeholders, which will be replaced by the actual environment variable values. The template file defines the basic structure of the container configuration and allows the specific configuration to be customized by replacing the placeholders. By introducing the template file, the generation process of the docker container configuration file is simplified, avoiding the repetitive work of manually writing the configuration file.
[0024] The template file and variable file are read through the first preset API, and the placeholders in the template file are replaced with the specific values defined in the variable file. This replacement process customizes the configuration of the docker container, ensuring that the parameters such as the container name and image tag in the configuration file meet the actual needs of the target environment. The docker container configuration file generated by the above steps can quickly adapt to different deployment environments without manually writing configuration files for each environment. In addition, the generated docker container configuration file can be directly used in the automated deployment process, which is an important part of continuous integration and continuous deployment (CI / CD).
[0025] Specifically, the process of generating a docker container configuration file through the first preset API can be summarized into the following steps: 1) Obtain the API document to obtain the template document of the docker container configuration file; 2) Use specific environment variables to replace the container name and image tag in the template document of the docker container configuration file; 3) Configure the environment variables in the variable file; 4) Pass the specific container name and image tag as parameters, the program modifies the variable file to achieve dynamic configuration, and the docker container configuration file loads the configuration according to the .env file, thereby achieving dynamic generation of the docker container configuration file.
[0026] Step S2, performing a second preset processing on the first preset API to obtain a second preset API, and generating a docker container configuration file according to the second preset API.
[0027] Based on the first preset API, further processing is performed to improve the environmental perception capability of the second preset API.
[0028] Specifically, performing a second preset processing on the first preset API to obtain the second preset API includes: automatically performing containerized deployment on the first preset API through an integrated webhook, continuous integration, and continuous delivery process to obtain the second preset API.
[0029] It is understandable that since containerized deployment provides an isolated operating environment, the second preset API will remain consistent in different environments (development, testing, production).
[0030] In one embodiment, a docker container configuration file is generated according to a second preset API, including: in response to detecting a change in code in a remote repository, triggering a continuous integration and / or continuous delivery process through a webhook deployed in the second preset API; reading the changed code information through the continuous integration process and / or the continuous delivery process, and generating a new image based on the changed code information; modifying a file for storing environment variables based on a service name corresponding to the changed code and an image tag of the newly generated image as input parameters to obtain a docker container configuration file.
[0031] Specifically, the second preset API supports integration with CI / CD tools (such as Jenkins, GitLab CI, etc.) through webhook. When the code in the code repository changes, the second preset API is automatically triggered to generate a new docker-compose.yml file and execute the corresponding Docker-Compose command. The second preset API service receives webhook notifications from the version control system (such as GitLab). When code is pushed to the remote repository, the repository management system sends a webhook request to the second preset API.
[0032] When code changes are pushed to a remote repository (such as GitLab), the repository detects the code changes and sends a trigger signal to the CI / CD tool based on the preset webhook configuration. After receiving the trigger signal, the CI / CD tool checks the relevant information of the trigger event (used to determine the services that need to be compiled and deployed), including the branch name where the code is located and the specific services or files that have changed.
[0033] According to the read change information, the CI / CD tool will execute the build process and compile the changed services. After the build is completed, a new docker image will be generated and the images will be labeled accordingly (usually including version number and build number). After the new image is generated, the CI / CD tool will call the second preset API interface and pass the service name and image tag as parameters. After receiving the service name and image tag, the second preset API interface will update the environment variable file (.env file), which contains the environment variables used to configure Docker-Compose. For example, the SERVICE_IMAGE_TAG environment variable may be set to specify the docker image tag of the service. After updating the environment variable file, the second preset API will generate a new docker container configuration file, which contains the latest service configuration and image tag. Subsequently, the second preset API or CI / CD tool will execute the Docker-Compose command, such as docker-compose up -d, to pull the new image and deploy the service. In this way, the deployment process is automated.
[0034] In one embodiment, after generating the docker container configuration file, the method further includes: storing a snapshot of the generated docker container configuration file, and generating a code corresponding to the docker container configuration file, so that the first preset API performs version control on the docker container configuration file according to the code.
[0035] Here, by modifying the input parameters of the variable file, the successfully modified variable file snapshot is stored, and a corresponding ID and modification instructions are generated. The user can switch the corresponding docker container configuration file according to the modification instructions, which can realize flexible switching of the docker container configuration file version, and the docker container configuration file is no longer needed when rolling back the version.
[0036] It should be noted that the docker container configuration file generated by the second preset API can be version controlled by the same means.
[0037] Step S3: managing the docker container configuration file through the first preset API and / or the second preset API to make the docker container configurations in different environments consistent.
[0038] Here, by managing the docker container configuration file through the first preset API and the second preset API, it can be ensured that the container configuration remains consistent in different development, test and production environments, thereby reducing errors caused by environmental differences.
[0039] In one embodiment, a docker container configuration file is managed through a first preset API and / or a second preset API, including: using placeholders to define dynamic variables in the docker container configuration file, and setting default values for the dynamic variables in a file for storing environment variables; in response to the first preset API and / or the second preset API being called, parsing the incoming parameters used to call the first preset API or the second preset API, and identifying the variable name and the corresponding variable value in the incoming parameters; using the variable name and the corresponding variable value in the incoming parameters to replace the variable value of the same variable in the file for storing environment variables; after completing the variable replacement, reloading the docker container configuration file to ensure that the docker container configuration file uses the updated variable value.
[0040] It can be understood that the above describes a process of dynamically updating and reloading docker container configurations, which may include: in the docker container configuration file, using placeholders to define dynamic variables, these variables can take different values in different deployment environments. In the variable file, set default values for these dynamic variables, so that when the specific variable value is not provided, the docker container can start with these default values.
[0041] When the first preset API or the second preset API is called, the backend server will parse the incoming call parameters, which contain the variable names to be updated and their corresponding values. By identifying the called variable names and their corresponding values, the system will use these incoming values to replace the corresponding variable values in the variable file. After completing the update of the variable file, reload the docker container configuration file to ensure that the docker container uses the latest variable values to reflect the latest configuration changes. In the above way, a closed-loop dynamic configuration management process of a docker container is completed, so that the docker container can dynamically adjust its configuration under different environments and conditions without manual intervention.
[0042] In one embodiment, the docker container management method further includes: setting login permissions for the first preset API and the second preset API, and calling the first preset API and / or the second preset API through a preset authorization code.
[0043] Exemplarily, the API adopts a standard identity authentication and authorization mechanism such as OAuth 2.0 to ensure that only authorized users can call the first preset API and / or the second preset API.
[0044] Specifically, developers register applications with OAuth 2.0 providers (such as Google, GitHub, self-built OAuth servers, etc.) and obtain client IDs and client secrets (Client ID and Client Secret). When using the first preset API and / or the second preset API, you need to log in first. The user accesses the application, clicks the "Login" button, and enters the credentials (user name and password) for identity authentication. After the user logs in and agrees to the authorization, the OAuth 2.0 provider will give the user an authorization code (Authorization Code). After receiving the authorization code, send a request to the OAuth 2.0 provider to exchange the authorization code for an access token (Access Token).
[0045] In addition, the first preset API and / or the second preset API supports plug-in design, and the user can expand the functionality of the API as needed.
[0046] It should be noted that the first preset API and / or the second preset API has a built-in configuration verification function to ensure that the generated Docker container configuration file complies with the standard format of Docker-Compose and reduce runtime errors.
[0047] Specifically, the client requests the interface to pass in parameters (image tags), verifies the standardization of image tags, and periodically scans the Docker container configuration file to ensure that it complies with the Docker-Compose.yml file specification (for example, the format is repository:tag). The first preset API and / or the second preset API will generate a verification report to record the verification status of the file and any problems found. Furthermore, during use, the first preset API and / or the second preset API will record operation logs and operation error information to help users track and debug problems during the deployment process.
[0048] The docker container management method provided by the present application obtains the first preset API and the second preset API by upgrading the preset API, which support the dynamic generation of docker container configuration files, so that users can flexibly generate configuration files according to their needs, reducing the complexity of manual writing and management, and the version control function ensures the consistency and traceability of the configuration. Through the integration of webhooks and CI / CD tools, the first preset API and the second preset API also support environmental awareness and detailed logging, realize automated deployment and management, reduce manual intervention, and improve deployment efficiency and stability. Specifically, the technical effects that can be produced by the docker container management method provided by the present application can be summarized as follows: 1) Improve the degree of automation Automated deployment: The first preset API and the second preset API can easily integrate the container orchestration process into the automation script and CI / CD process to achieve automated deployment and upgrade.
[0049] Automated management: Automated container management reduces manual intervention and reduces the possibility of human error.
[0050] 2) Strong integration capability System integration: The first preset API and the second preset API provide standardized interfaces, making it easier to integrate Docker Compose with other systems and tools, such as monitoring tools, log management systems, etc.
[0051] Cross-platform compatibility: The first preset API and the second preset API are designed to support cross-platform use, improving consistency and compatibility in different environments.
[0052] 3) Simplify operations Simplified configuration: The first preset API and the second preset API simplify the configuration process of multi-container applications and reduce the size and complexity of configuration files.
[0053] Ease of use: Provides a more friendly user interface so that non-professional users can easily manage containers.
[0054] 4) High maintainability Service updates: The first and second preset APIs make it easier to update and replace services without affecting other running services.
[0055] Version control: The first preset API and the second preset API can help implement version control and rollback of services.
[0056] 5) Low cost Reduced labor costs: Automation reduces manual work, thereby reducing labor costs.
[0057] Save resource costs: More efficient resource management can reduce unnecessary hardware investments.
[0058] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0059] Figure 2This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 2 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the electronic device may also include hardware required for other services.
[0060] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 2 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0061] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.
[0062] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a data processing device at the logical level. The processor executes the program stored in the memory and is specifically used to execute the docker container management method provided in this embodiment.
[0063] Of course, in addition to software implementation methods, the electronic device of the present application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0064] An embodiment of the present application also proposes a computer-readable storage medium, which stores one or more programs, and the one or more programs include instructions. When the instructions are executed by a portable electronic device including multiple application programs, the portable electronic device can execute the docker container management method provided by the present application.
[0065] In short, the above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0066] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0067] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0068] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0069] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
Claims
1. A docker container management method, characterized in that: include: Perform a first preset operation on a preset API to obtain a first preset API, and generate a docker container configuration file according to the first preset API; Perform a second preset processing on the first preset API to obtain a second preset API, and generate a docker container configuration file according to the second preset API; The docker container configuration file is managed through the first preset API and / or the second preset API to make the docker container configurations in different environments consistent.
2. The method according to claim 1, characterized in that The performing a first preset operation on the preset API to obtain the first preset API includes: The processing logic of the preset API is expanded, the database schema of the preset API is updated, and the document of the preset API is updated to provide new functions and endpoints for the preset API to obtain the first preset API.
3. The method according to claim 1, characterized in that The dynamically generating a Docker container configuration file according to the first preset API includes: Create a variables file containing the target environment variables; Obtain a pre-stored template file of a docker container configuration file, and replace the container name and image tag of the corresponding environment variables in the template file with the target environment variable values in the variable file through the first preset API to obtain the docker container configuration file.
4. The method according to any one of claims 1 to 3, characterized in that The performing a second preset processing on the first preset API to obtain a second preset API includes: The first preset API is automatically deployed in a containerized manner through an integrated webhook, continuous integration, and continuous delivery process to obtain the second preset API.
5. The method according to claim 4, characterized in that The generating a docker container configuration file according to the second preset API includes: In response to detecting a change in code in a remote repository, triggering the continuous integration and / or continuous delivery process through the webhook deployed in the second preset API; Reading the changed code information through the continuous integration process and / or the continuous delivery process, and generating a new image based on the changed code information; The file for storing environment variables is modified according to the service name corresponding to the changed code and the image tag of the newly generated image as input parameters to obtain the docker container configuration file.
6. The method according to claim 3 or 5, characterized in that: After generating the docker container configuration file, the method further includes: The generated snapshot of the docker container configuration file is stored, and a code corresponding to the docker container configuration file is generated, so that the first preset API performs version control on the docker container configuration file according to the code.
7. The method according to claim 1 or 3, characterized in that: The managing the docker container configuration file by using the first preset API and / or the second preset API includes: Define dynamic variables using placeholders in the Docker container configuration file, and set default values for the dynamic variables in the file for storing environment variables; In response to the first preset API and / or the second preset API being called, parsing input parameters used to call the first preset API or the second preset API, and identifying variable names and corresponding variable values in the input parameters; Using the variable name and the corresponding variable value in the input parameter to replace the variable value of the same variable in the file for storing environment variables; After completing the variable replacement, reload the Docker container configuration file to ensure that the Docker container configuration file uses the updated variable value.
8. The method according to claim 1, characterized in that: The method further comprises: Login permissions are set for the first preset API and the second preset API, and the first preset API and / or the second preset API are called through a preset authorization code.
9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the steps of the Docker container management method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor, the steps of the Docker container management method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Docker container construction method and device, equipment and storage medium
CN110058863A
Micro-service deployment method for realizing DevOps based on Jenkins
CN111309441A
Webpage application processing method and device, storage medium and electronic equipment
CN115048153A
Container cluster deployment method, device and system, electronic equipment and storage medium
CN115857982A
Mirror image file deployment method, system and device and storage medium
CN116820493A