A method, system, and computer-readable storage medium for container image matching.
By building a relational database between container images and test environment commands, the problem of image selection difficulties for users when creating containers under cluster management is solved, enabling quick matching of suitable images and reducing operating costs and restart frequency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-21
- Publication Date
- 2026-03-10
AI Technical Summary
When creating containers under cluster management, users need to manually try multiple images to find a suitable one, resulting in frequent restarts, increased operational costs, and wasted manpower.
Build a database that maps container images to test environment commands. By matching test environment commands, you can quickly find the right container image and reduce the number of restarts.
By leveraging the matching mechanism of relational databases, suitable container images can be quickly found, reducing operational costs, minimizing restarts, and improving efficiency.
Smart Images

Figure CN114706654B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer containers, and in particular to a container matching image method, system and computer readable storage medium. BACKGROUND
[0002] At present, in the personal container under the cluster management, the user needs to select an image when creating a container, and there is a big environment difference between different images. In order to facilitate development and use, the user needs to find an image suitable for the development and training environment.
[0003] The existing way to find a suitable image is for the user to try one by one, or consult the maintenance personnel. When the user tries one by one, the user needs to try a new image multiple times, and each time of trying a new image needs to be restarted, which may cause a series of problems such as port change, resource allocation queuing, and increases the operation cost of the user, thereby causing the waste of human cost. SUMMARY
[0004] Therefore, the embodiments of the present application provide a container matching image method, system and computer readable storage medium, which can solve the problem that the existing container cannot quickly adapt to a suitable image when creating, thereby increasing the operation cost of the system. The specific technical solution contents are as follows:
[0005] In a first aspect, the embodiments of the present application provide a container matching image method, which comprises:
[0006] Building a relationship database of container image and first test environment instruction;
[0007] Obtaining a container image request of a user, the container image request comprising a second test environment instruction corresponding to a container image;
[0008] Matching the second test environment instruction with the first test environment instruction, and searching for a container image matched with the second test environment instruction in the relationship database.
[0009] Preferably, the matching of the second test environment instruction with the first test environment instruction and the searching for the container image matched with the second test environment instruction in the relationship database comprises:
[0010] Searching for a first test environment instruction matched with the second test environment instruction in the relationship database;
[0011] If the first test environment instruction fully contains the second test environment instruction, extracting the container image corresponding to the first test environment instruction, and creating a container.
[0012] Preferably, the method further comprises:
[0013] If the second test environment instruction fully contains the first test environment instruction, extracting the container image corresponding to the first test environment instruction, creating a container and performing internal testing in the container;
[0014] If the internal testing in the container is successful, replacing the first test environment instruction with the second test environment instruction in the relational database.
[0015] Preferably, the relational database maintains an image tag corresponding to the container image one-to-one, and the method further comprises:
[0016] If the internal testing in the container fails, continue searching for other first test environment instructions that satisfy the second test environment instruction fully containing the first test environment instruction, extract the image tag of the container image corresponding to the other first test environment instruction, replace the image tag in the current container yaml configuration file, restart the container, and then re-perform internal testing.
[0017] Preferably, the method further comprises:
[0018] If the re-performed internal testing fails, re-match at least a preset number of times of the first test environment instruction and the second test environment instruction.
[0019] Preferably, the method further comprises:
[0020] If the re-matching of the first test environment instruction and the second test environment instruction satisfies the preset number of times, and the required container image is still not found, maintaining an image tag list, the image tag list maintains container images in the image repository that do not have a homologous image layer with the container image in the relational database;
[0021] According to the second test environment instruction, searching for a container image matching the second test environment instruction in the image tag list.
[0022] Preferably, the maintaining of the image tag list comprises:
[0023] Traversing all container images in the image repository to obtain a first image layer structure of the currently traversed container image;
[0024] Traversing the relational database image tag to obtain a second image layer structure of the container image corresponding to the traversed image tag
[0025] Judging whether the topmost image layer of the first image layer structure has a homologous image layer with the second image layer structure;
[0026] If the topmost image layer of the first image layer structure has a homologous image layer with the second image layer structure, continue traversing all container images in the image repository to obtain a first image layer structure of the next container image traversed;
[0027] If the topmost mirror layer of the first mirror layer structure has no homologous mirror layer with the second mirror layer structure, it is determined whether the topmost mirror layer of the second mirror layer structure has a homologous mirror layer with the first mirror layer structure;
[0028] If the topmost mirror layer of the second mirror layer structure has a homologous mirror layer with the first mirror layer structure, the mirror tag corresponding to the second mirror layer structure is updated to the mirror tag of the container image corresponding to the first mirror layer structure in the relational database;
[0029] If the topmost mirror layer of the first mirror layer structure has no homologous mirror layer with the second mirror layer structure, and the topmost mirror layer of the second mirror layer structure has no homologous mirror layer with the first mirror layer structure, the mirror tag is updated to the last line of the mirror tag list.
[0030] Preferably, the method further comprises:
[0031] If the required container image is still not matched by the mirror tag list, a prompt information is returned.
[0032] In a second aspect, an embodiment of the present application provides a system for matching a container image, and the system comprises:
[0033] A maintaining module is configured to construct a relational database of container images and first test environment instructions;
[0034] A requesting module is configured to obtain a container image request of a user, wherein the container image request comprises a second test environment instruction corresponding to a container image;
[0035] A matching module is configured to match the second test environment instruction with the first test environment instruction, and search for a container image matching the second test environment instruction in the relational database.
[0036] In a third aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the method for matching a container image according to any one of the preceding embodiments.
[0037] In summary, compared with the prior art, the technical scheme provided by the embodiments of the present application has at least the following beneficial effects:
[0038] By maintaining the relational database, the relational database records the relationship between the container image and the first test environment instruction, so that the required container image can be found by matching the first test environment instruction. The user proposes a container image request, which contains the second test environment instruction of the required container image. The first test environment instruction and the second test environment instruction are both used to describe the test environment. The first test environment instruction describes the test environment suitable for the corresponding container image, and the second test instruction describes the test environment of the container image required by the user. By matching the second test environment instruction with the first test environment instruction, if there is a first test environment instruction matching the second test environment instruction in the relational database, a suitable container image can be selected, the number of container restarts is reduced, the required container image is quickly matched, and the operation cost is reduced. BRIEF DESCRIPTION OF DRAWINGS
[0039] Figure 1 is a flowchart of a method for matching a container image according to an embodiment of the present application.
[0040] Figure 2 is a flowchart of a method for matching a container image according to another embodiment of the present application. DETAILED DESCRIPTION
[0041] The specific embodiments are only an explanation of the present application, and are not a limitation of the present application. Those skilled in the art can make modifications to the embodiments without creative contribution after reading the present specification, and the modifications are protected by the patent law as long as they are within the scope of the claims of the present application.
[0042] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme of the embodiments of the present application will be described clearly and completely in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative contribution are within the scope of protection of the present application.
[0043] In addition, the term "and / or" in the present application is only to describe the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which means that there are three cases of A alone, A and B together, and B alone. In addition, the character " / " in the present application generally represents an "or" relationship between the associated objects unless otherwise specified.
[0044] The terms "first", "second", and the like are used to distinguish between the same or similar items or elements having essentially the same function, and it should be understood that there is no logical or chronological dependency between "first", "second", and "nth", and the number and execution order are not limited.
[0045] The embodiments of the present application are described in further detail below with reference to the accompanying drawings.
[0046] Referring to Figure 1 In an embodiment of the present application, a method for matching a container image is provided, and the main steps of the method are described as follows:
[0047] S1: Constructing a relational database of container images and first test environment instructions;
[0048] S2: Obtaining a container image request of a user, the container image request including a second test environment instruction corresponding to a container image;
[0049] S3: Matching the second test environment instruction with the first test environment instruction, and searching for a container image matching the second test environment instruction in the relational database.
[0050] Specifically, the relational database of container images and first test environment instructions is constructed by adding a label of a suitable test environment, i.e., a first test environment instruction, to the container image, so as to classify the container image according to the suitable environment; in this embodiment, the first test environment instruction is a string.
[0051] Specifically, in this embodiment, the second test environment instruction is included in the container image request submitted by the user, the container image request submitted by the user through the client includes container information such as gpu, cpu, memory, container name, and the second test environment instruction, and the second test environment instruction is a series of test scripts provided by the user to verify whether the new container meets the standard. In the field, after an engineer creates a new container, the engineer will experimentally test some environments in the new container to determine whether the container image is suitable.
[0052] Further, in this embodiment, the second test environment instruction is submitted in the form of a file path or a string. If it is submitted in the form of a file path, the file is automatically obtained according to the file path, and the file content is converted into a string, and finally the corresponding interface is sent in the form of a string; if it is submitted in the form of a string, it is directly sent to the corresponding interface.
[0053] The relational database records the relationship between the container image and the corresponding first test environment instruction, and specifically, the ID, image label, and first test environment instruction are recorded in each row of the database.
[0054] The application maintains a relational database, and the relational database records the relationship between the container image and the first test environment instruction, so that the required container image can be found by matching the first test environment instruction. The user proposes a container image request, and the second test environment instruction of the required container image is included in the container image request. The first test environment instruction and the second test environment instruction are both used to describe the test environment. The first test environment instruction describes the test environment suitable for the corresponding container image, and the second test instruction describes the test environment of the container image required by the user. By matching the second test environment instruction with the first test environment instruction, if the relational database has the first test environment instruction matched with the second test environment instruction, the appropriate container image can be selected, the number of times of restarting the container is reduced, and the operation cost is reduced.
[0055] With reference to Figure 2 Optionally, in another embodiment, step S3 comprises:
[0056] S31: searching the relational database for the first test environment instruction matched with the second test environment instruction;
[0057] S32: if the first test environment instruction fully contains the second test environment instruction, extracting the container image corresponding to the first test environment instruction, and creating a container.
[0058] Specifically, in the embodiment, the second test environment instruction includes a second test environment string, and the first test environment instruction includes a first test environment string. The first test environment instruction fully contains the second test environment instruction, that is, the first test environment string fully contains the second test environment string. The first test environment string may also have other contents in addition to the second test environment string. The first test environment string contains the image container required in the current container image request, and the image container can be directly selected to establish the container.
[0059] In the embodiment, if the second test environment string that fully contains the first test environment string about the container image in the first test environment instruction cannot be searched, the search in the relational database is ended, and the image warehouse image matching is performed. In other embodiments, an error can also be reported directly, and manual repair is performed.
[0060] Optionally, in another embodiment, the method further comprises:
[0061] S33: if the second test environment instruction fully contains the first test environment instruction, extracting the container image corresponding to the first test environment instruction, creating a container, and performing a container internal test;
[0062] S34: if the container internal test is successful, replacing the first test environment instruction with the second test environment instruction in the relational database.
[0063] Specifically, in the embodiment, the second test environment instruction fully contains the first test environment instruction, that is, the second test environment string fully contains the first test environment string, which indicates that the image container corresponding to the first test environment instruction contains the part of conditions for implementing the second test environment instruction. The container is established by using the container image corresponding to the first test environment instruction, and there is a case that meets the user's demand.
[0064] After the container is established by using the container image corresponding to the first test environment instruction, the test environment is performed in the container, that is, the internal test is performed. If the internal test has no error, it indicates that the selected container image meets the condition and can meet a wider test instruction. At this time, the first test environment instruction matched in the relational database is replaced by the second test environment instruction to further improve the application range of the container image.
[0065] In the embodiment, the first test environment instruction matched in the relational database is replaced by the second test environment instruction specifically as follows: the first test environment string matched in the relational database is replaced by the second test environment string.
[0066] Optionally, in another embodiment, the relational database maintains an image tag corresponding to the container image in one-to-one manner, and the method further includes:
[0067] S35: If the internal test of the container fails, other first test environment instructions meeting the condition that the second test environment instruction fully contains the first test environment instruction are continuously searched, the image tag of the container image corresponding to the other first test environment instruction is extracted to replace the image tag in the yaml configuration file of the container, so as to restart the container, and then the internal test is performed again.
[0068] Specifically, in the embodiment, after one internal test fails, other first test environment instructions meeting the condition that the second test environment instruction fully contains the first test environment instruction are continuously searched in the relational database, the container image corresponding to the first test environment instruction is extracted, and the image tag of the container image is replaced by the image tag in the yaml configuration file of the container established in the previous matching, so that the system restarts the container. Through the current container restart mode, the container can be started in place, the resources, ports and other information remain unchanged, and the running and creation of other containers are not affected.
[0069] Specifically, in the present embodiment, the matching of the second test environment instruction with the first test environment instruction that still has searchable unapplied container image is performed multiple times by the container restart mode of the present embodiment until there is no matching first test environment instruction or the container image of the internal test success is matched. In other embodiments, a preset number of times of matching the second test environment instruction with the first test environment instruction can also be preset, and when the preset number of times is reached, the matching is no longer performed.
[0070] Referring to Figure 2 Optionally, in another embodiment, the method further comprises:
[0071] S36: If the test fails after re-performing the internal test, at least re-matching the first test environment instruction with the second test environment instruction for a preset number of times.
[0072] Specifically, in the present embodiment, if the test fails after re-performing the internal test, at least re-matching the first test environment instruction with the second test environment instruction for a preset number of times, the matching is performed for a preset number of times to improve the success rate of matching. In the present embodiment, the preset number of times can be 1, 2, 3, 4, etc., which is not limited herein.
[0073] Optionally, in another embodiment, the method further comprises:
[0074] S37: If the first test environment instruction and the second test environment instruction are re-matched for a preset number of times, and the required container image is still not found, maintaining an image tag list, and the image tag list maintains the container images in the image repository that do not have the same image layer as the container images in the relational database;
[0075] S38: According to the second test environment instruction, searching for a container image matching the second test environment instruction in the image tag.
[0076] Specifically, in the present embodiment, if the first test environment instruction and the second test environment instruction are re-matched for a preset number of times, and the required container image is still not found, the preset number of times of the first test environment instruction corresponding to the container image contained by the second test environment instruction may replace the image tag in the yaml configuration file in the current container, and the internal test is re-performed, but the test still fails.
[0077] In the present embodiment, the image tag list is maintained, and the container images not in the relational database are stored in the image tag list. The container image matching the second test environment instruction is searched in the image tag list to meet the user's demand and further improve the success rate of matching.
[0078] Optionally, in another embodiment, the method of maintaining the image tag list comprises:
[0079] 1. traversing all container images in the image repository to obtain a first image layer structure of a container image being traversed;
[0080] 2. traversing the image tags in the relational database to obtain a second image layer structure of a container image corresponding to the image tag being traversed;
[0081] 3. determining whether the topmost image layer of the first image layer structure and the second image layer structure have a homologous image layer;
[0082] 4. if the topmost image layer of the first image layer structure and the second image layer structure have a homologous image layer, then continue to traverse all container images in the image repository to obtain a first image layer structure of a next container image being traversed;
[0083] 5. if the topmost image layer of the first image layer structure and the second image layer structure do not have a homologous image layer, then determine whether the topmost image layer of the second image layer structure and the first image layer structure have a homologous image layer;
[0084] 6. if the topmost image layer of the second image layer structure and the first image layer structure have a homologous image layer, then update the image tag corresponding to the second image layer structure in the relational database to the image tag of the container image corresponding to the first image layer structure;
[0085] 7. if the topmost image layer of the first image layer structure and the second image layer structure do not have a homologous image layer, and the topmost image layer of the second image layer structure and the first image layer structure do not have a homologous image layer, then update the image tag to the last row of the image tag list.
[0086] Specifically, each image is composed of a plurality of image layers. In the present embodiment, at the initial time, the image tag list is empty. When the topmost image layer of the first image layer structure and the second image layer structure have a homologous image layer, it indicates that the container image corresponding to the first image layer structure already exists in the relational database, and the container image can be ignored. When the topmost image layer of the second image layer structure and the first image layer structure have a homologous image layer, it indicates that the container image corresponding to the first image layer structure is more comprehensive than the container image corresponding to the second image layer structure in the relational database, and thus the image tag of the container corresponding to the second image layer structure in the relational database is replaced by the image tag of the container corresponding to the first image layer structure.
[0087] Through the arrangement of the present embodiment, a large number of images can be excluded by optimization, so that the images in the image tag list have less overlap with the images in the relational database.
[0088] Optionally, in another embodiment, the method further comprises:
[0089] S39: If no match is found for the required container image from the mirror tag list, return a prompt message.
[0090] Specifically, in the present embodiment, the prompt message is used to tell the user that there is no matching container image at present.
[0091] It should be understood that the size of the serial number of each step in the above embodiments does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0092] In an embodiment of the present application, a container matching image system is provided, which corresponds to the container matching image method in the above embodiments. The container matching image system includes:
[0093] A maintenance module for constructing a relational database of container images and first test environment instructions;
[0094] A request module for obtaining a container image request of a user, the container image request including a second test environment instruction corresponding to a container image;
[0095] A matching module for matching the second test environment instruction with the first test environment instruction, and searching for a container image matching the second test environment instruction in the relational database.
[0096] Further, in another embodiment, the second test environment instruction is submitted in the form of a file path or a string.
[0097] Further, in another embodiment, the matching module is further used to search for a first test environment instruction matching the second test environment instruction in the relational database; if the first test environment instruction contains the second test environment instruction, extract the container image corresponding to the first test environment instruction, and create a container.
[0098] Further, in another embodiment, the matching module is further used to extract the container image corresponding to the first test environment instruction if the second test environment instruction contains the first test environment instruction, create a container and perform internal testing of the container; if the internal testing of the container is successful, replace the first test environment instruction with the second test environment instruction in the relational database.
[0099] Further, in another embodiment, the matching module is further configured to, if the internal test of the container fails, continue searching for other first test environment instructions that satisfy the second test environment instruction and fully contain the first test environment instruction, extract an image tag of a container image corresponding to the other first test environment instruction, replace an image tag in a current container yaml configuration file with the image tag, restart the container, and then re-perform the internal test.
[0100] Further, in another embodiment, the matching module is further configured to, if the re-performed internal test fails, re-match the first test environment instruction and the second test environment instruction at least a preset number of times.
[0101] Further, in another embodiment, the matching module is further configured to, if the re-matching of the first test environment instruction and the second test environment instruction satisfies the preset number of times, still fails to find the required container image, maintain an image tag list, the image tag list maintains container images in the image repository that do not have a homologous image layer with container images in the relational database, and search for a container image matching the second test environment instruction in the image tag according to the second test environment instruction.
[0102] Further, in another embodiment, the method of maintaining the image tag list comprises:
[0103] 1. Iterating through all container images in the image repository to obtain a first image layer structure of a currently iterated container image;
[0104] 2. Iterating through image tags in the relational database to obtain a second image layer structure of a container image corresponding to the iterated image tag;
[0105] 3. Determining whether the topmost image layer of the first image layer structure has a homologous image layer with the second image layer structure;
[0106] 4. If the topmost image layer of the first image layer structure has a homologous image layer with the second image layer structure, continuing to iterate through all container images in the image repository to obtain a first image layer structure of a next iterated container image;
[0107] 5. If the topmost image layer of the first image layer structure does not have a homologous image layer with the second image layer structure, determining whether the topmost image layer of the second image layer structure has a homologous image layer with the first image layer structure;
[0108] 6. If the topmost image layer of the second image layer structure has a homologous image layer with the first image layer structure, updating, in the relational database, an image tag corresponding to the second image layer structure to an image tag of a container image corresponding to the first image layer structure;
[0109] 7. If the topmost mirror layer of the first mirror layer structure has no homologous mirror layer with the second mirror layer structure, and the topmost mirror layer of the second mirror layer structure has no homologous mirror layer with the first mirror layer structure, the mirror tag is updated to the last line of the mirror tag list.
[0110] Further, in another embodiment, the matching module is further configured to return a prompt if no required container image is matched by the mirror tag list.
[0111] The modules of the container matching mirror image system described above can be implemented by software, hardware, and combinations thereof, in whole or in part. The modules described above can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to the modules.
[0112] In one embodiment of the embodiments of the present application, a computer device is provided, which can be a server. The computer device includes a processor, a memory, and a network interface connected by a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device can be implemented by any type of volatile or non-volatile storage device or a combination thereof, including but not limited to: a magnetic disk, an optical disk, an EEPROM (Electrically-Erasable Programmable Read Only Memory), an EPROM (Erasable Programmable Read Only Memory), an SRAM (Static Random Access Memory), a ROM (Read-Only Memory), a magnetic storage, a flash memory, a PROM (Programmable Read-Only Memory). The memory of the computer device provides an environment for the operation of the operating system and computer programs stored therein. The network interface of the computer device is configured to communicate with the external terminal through the network connection. The computer program is executed by the processor to implement the steps of the container matching mirror image method described in the embodiments.
[0113] In an embodiment of the present application, a computer readable storage medium is provided, which stores a computer program, and the computer program, when executed by a processor, implements the method steps of the container matching image method described in the above embodiment. The computer readable storage medium includes a ROM (Read-Only Memory), a RAM (Random-Access Memory), a CD-ROM (Compact Disc Read-Only Memory), a magnetic disk, a floppy disk, and the like.
[0114] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above division of functional units and modules is exemplified, and in actual application, the above functions can be completed by different functional units and modules according to needs, that is, the internal structure of the system described in the present application is divided into different functional units or modules to complete all or part of the above described functions.
Claims
1. A method of container matching mirroring, the method comprising: The method comprises: constructing a relational database of container images and first test environment instructions; obtaining a container image request of a user, the container image request comprising a second test environment instruction corresponding to a required container image; matching the second test environment instruction with the first test environment instruction, and searching for a container image in the relational database that matches the second test environment instruction; specifically, searching for a first test environment instruction in the relational database that matches the second test environment instruction; if the first test environment instruction fully contains the second test environment instruction, extracting the container image corresponding to the first test environment instruction to create a container; if the second test environment instruction fully contains the first test environment instruction, extracting the container image corresponding to the first test environment instruction to create a container and perform internal testing of the container; if the internal testing of the container is successful, replacing the first test environment instruction with the second test environment instruction in the relational database.
2. The method of container matching mirroring of claim 1, wherein, The relational database maintains an image tag corresponding to each container image, and the method further comprises: if the internal testing of the container fails, continuing to search for another first test environment instruction that satisfies the condition that the second test environment instruction fully contains the first test environment instruction, extracting the image tag of the container image corresponding to the other first test environment instruction to replace the image tag in the current container yaml configuration file, restarting the container, and then re-performing internal testing.
3. The method of container matching mirroring of claim 2, wherein, The method further comprises: if the re-performed internal testing fails, re-matching the first test environment instruction with the second test environment instruction at least a preset number of times.
4. The method of container matching mirroring of claim 3, wherein, The method further comprises: if the re-matching of the first test environment instruction with the second test environment instruction satisfies the preset number of times but the required container image is still not found, maintaining a list of image tags, the list of image tags maintaining container images in an image repository that do not have a common image layer with the container images in the relational database; searching for a container image in the list of image tags that matches the second test environment instruction according to the second test environment instruction.
5. The method of container matching mirroring of claim 4, wherein, The maintenance of the list of image tags comprises: traversing all container images in the image repository to obtain a first image layer structure of a currently traversed container image; traversing the image tags in the relational database to obtain a second image layer structure of a container image corresponding to a traversed image tag; determining whether the topmost image layer of the first image layer structure has a common image layer with the second image layer structure; if the topmost image layer of the first image layer structure has a common image layer with the second image layer structure, continuing to traverse all container images in the image repository to obtain a first image layer structure of a next traversed container image; if the topmost image layer of the first image layer structure does not have a common image layer with the second image layer structure, determining whether the topmost image layer of the second image layer structure has a common image layer with the first image layer structure; if the topmost image layer of the second image layer structure has a common image layer with the first image layer structure, updating the image tag corresponding to the second image layer structure in the relational database to the image tag of the container image corresponding to the first image layer structure. If the topmost mirror layer of the first mirror layer structure has no homologous mirror layer with the second mirror layer structure, and the topmost mirror layer of the second mirror layer structure has no homologous mirror layer with the first mirror layer structure, the mirror tag is updated to the last line of the mirror tag list.
6. The method of container matching mirroring of claim 5, wherein, The method further comprises: If the required container image is still not matched by the mirror tag list, a prompt message is returned.
7. A system for container matching mirroring, the system comprising: A system for performing the method of matching a container image according to any one of claims 1 to 6, the system comprising: A maintenance module for constructing a relational database of container images and first test environment instructions; A request module for obtaining a container image request of a user, the container image request comprising a second test environment instruction corresponding to a required container image; A matching module for matching the second test environment instruction with the first test environment instruction, and searching for a container image matching the second test environment instruction in the relational database.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the steps of the method of matching a container image according to any one of claims 1 to 6.
Citation Information
Patent Citations
Code processing method and device and code release system
CN107797914A
Cluster server application deployment system
CN113900670A