Container image processing method and apparatus, and readable medium
The image layer files of the container engine and container warehouse are shared through the image processing device, which solves the problem of redundant storage, saves storage space, and achieves efficient management of image layer files.
Patent Information
- Application Number
- PCT/CN2024/076243
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-22
- Filing Date
- 2024-02-06
- Publication Date
- 2024-08-29
AI Technical Summary
Container engines and container warehouses have the problem of redundant storage of the same image, resulting in a waste of storage space.
The image layer file is stored through the image processing device, allowing the container engine and the container warehouse to share the image layer file to avoid repeated storage, and use call count parameters to manage the use and deletion of the image layer file.
It saves the storage space of container engines and container warehouses, avoids redundant storage, and improves storage efficiency.
Smart Images

Figure CN2024076243_29082024_PF_FP_ABST
Abstract
Description
Container image processing method, device and readable medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to Chinese patent application CN 202310172871.0, entitled “Container Image Processing Method, Device and Readable Medium,” filed on February 22, 2023, the entire contents of which are incorporated herein by reference. Technical Field
[0003] The present disclosure relates to the technical field of cloud computing, and in particular to a container image processing method, device, and readable medium. Background Art
[0004] Containers are a lightweight virtualization technology widely used in cloud computing due to their fast startup speed and easy installation and deployment. Container technology is developing rapidly, and containers consist of two parts: a container engine and an image. The container engine is a tool for managing containers and container images, responsible for creating, destroying, and stopping containers, as well as pulling, deleting, and pushing container images. Starting a container requires a corresponding container image. If the container engine has the image stored locally, the container can be started directly. If the container engine does not have the image stored locally, it will download it from the container repository before starting the container. The image is structured in layers, consisting of a manifest file, a configuration file, and multiple layer files. The manifest and configuration files generally take up less space, while the layer files are used to store the actual image data and generally take up more space.
[0005] The container engine and container repository have the problem of redundant storage of the same image, resulting in a waste of storage space.
[0006] Summary of the Invention
[0007] The present disclosure provides a container image processing method, device, and readable medium.
[0008] An embodiment of the present disclosure provides a container image processing method, which is applied to an image processing device. The method includes: receiving a first image storage request sent by a first container device, obtaining a first image manifest of a first target image carried in the first image storage request; locally querying an image layer file corresponding to the first image manifest; and, if the image processing device stores the image layer file corresponding to the first image manifest, returning an image storage response to the first container device so that the first container device can access the image layer file.
[0009] An embodiment of the present disclosure also provides a container image processing method, which is applied to a container device, the method comprising: storing an image manifest and a configuration file of a target image; sending an image storage request carrying the image manifest to an image processing device; receiving an image storage response returned by the image processing device, and calling the image layer file from the image processing device, wherein the container device comprises a first container device or a second container device, and when the container device comprises the first container device, the target image is a first target image, the image manifest is a first image manifest, and the image storage request is a first image storage request; when the container device comprises the second container device, the target image is a second target image, the image manifest is a second image manifest, and the image storage request is a second image storage request.
[0010] An embodiment of the present disclosure further provides an image processing device, comprising: one or more processors; and a storage device storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the container image processing method according to the present disclosure.
[0011] An embodiment of the present disclosure further provides a container device, comprising: one or more processors; and a storage device storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the container image processing method according to the present disclosure.
[0012] An embodiment of the present disclosure further provides a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the processor implements the container image processing method according to the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] FIG1 is a flowchart of a container image processing method using an image processing device as an execution body provided by an embodiment of the present disclosure;
[0014] FIG2 is another flowchart of a container image processing method using an image processing device as an execution body provided by an embodiment of the present disclosure;
[0015] FIG3 is another flow chart of a container image processing method using an image processing device as an execution body provided by an embodiment of the present disclosure;
[0016] FIG4 is another flow chart of a container image processing method using an image processing device as an execution body provided by an embodiment of the present disclosure;
[0017] FIG5 is a flowchart of a container image processing method using a container device as an execution subject provided by an embodiment of the present disclosure;
[0018] FIG6 is another flowchart of a container image processing method using a container device as an execution subject provided by an embodiment of the present disclosure;
[0019] FIG7 is a schematic diagram of a container engine importing an image provided by a specific example of the present disclosure;
[0020] FIG8 is a schematic diagram of importing an image into a container repository according to a specific example of the present disclosure;
[0021] FIG9 is a schematic diagram of a container engine deleting an image according to a specific example of the present disclosure;
[0022] FIG10 is a schematic diagram of deleting an image from a container repository according to a specific example of the present disclosure;
[0023] 11 to 14 are schematic diagrams of the architecture of the container system provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0024] Example embodiments will be described more fully hereinafter with reference to the accompanying drawings, but the example embodiments may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. On the contrary, these embodiments are provided so that this disclosure will be thorough and complete and will fully convey the scope of this disclosure to those skilled in the art.
[0025] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0026] The terms used herein are used only to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a," "an," and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "comprising" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements, and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or groups thereof is not excluded.
[0027] The embodiments described herein may be described with reference to plan views and / or cross-sectional views, with the aid of idealized schematic diagrams of the present disclosure. Thus, the example illustrations may be modified based on manufacturing techniques and / or tolerances. Therefore, the embodiments are not limited to the embodiments shown in the accompanying drawings, but include modifications of the configurations formed based on the manufacturing process. Therefore, the regions illustrated in the accompanying drawings are schematic in nature, and the shapes of the regions shown in the drawings illustrate specific shapes of the regions of the elements, but are not intended to be limiting.
[0028] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those skilled in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless expressly defined as such herein.
[0029] In the related art, the container engine and the container warehouse usually store images separately, and there is a problem of redundant storage of the same image, which easily leads to a waste of storage space. To solve the above problem, the embodiment of the present disclosure provides a container image processing method, and the system applied by the container image processing method includes a container engine, a container warehouse, an image processing device and an image storage device, wherein the image storage device is used to store image layer files, and the image processing device is used to provide shared image layer files for the container engine and the container warehouse. The container engine and the container warehouse are collectively referred to as container devices, and the container device includes a first container device and a second container device. The container engine can be one of the first container device and the second container device, and accordingly, the container warehouse is the other of the first container device and the second container device. In the embodiment of the present disclosure, the container engine is referred to as the first container device, and the container warehouse is referred to as the second container device. The container warehouse is a container for storing and managing image files, and the container engine is a tool for managing containers and container images, which is responsible for creating, destroying, and stopping containers, and is responsible for operations such as pulling, deleting, and pushing container images.
[0030] As shown in FIG1 , an embodiment of the present disclosure provides a container image processing method, which is applied to an image processing device and includes the following steps S11 to S13 .
[0031] In step S11 , a first image storage request sent by a first container device is received, and a first image list of a first target image carried in the first image storage request is obtained.
[0032] The image manifest describes information about configuration files and image layer files. The target image is the image to be processed, and the image is the file required to start the container. The first container device can be a container engine or a container repository. In this embodiment, the first container device is a container engine, and the second container device is a container repository.
[0033] In step S12, the image layer file corresponding to the first image manifest is searched locally.
[0034] In this step, the image processing device queries whether the image layer file corresponding to the first image list is stored locally. If it is stored locally, step S13 is executed.
[0035] In step S13 , if the image processing device stores the image layer file corresponding to the first image manifest, an image storage response is returned to the first container device so that the first container device can call the image layer file.
[0036] In this step, after determining that the image layer files of the first target image are stored locally, the image processing device returns an image storage response to the first container device, informing the first container device that it can call the image layer files. When starting a container, a corresponding container image is required. At this time, the first container device (i.e., the container engine) can access the image processing device and call the image layer files of the first target image stored in the image processing device. In this way, only one copy of the image layer files of the first target image can be saved in the image processing device, and the container engine and container repository can call the image layer files of the first target image.
[0037] According to the container image processing method provided by the embodiment of the present disclosure, an image processing device is used to store image layer files. The container engine and / or container warehouse initiate an image storage request to the image processing device. When the image processing device stores image layer files, the container engine and container warehouse can directly access the image processing device and reuse the same image layer files. There is no need to re-store the image layer files in the image processing device, thus avoiding duplicate storage and wasting storage space. In addition, there is no need to store image layer files separately in the container engine and container warehouse, thereby solving the problem of redundant storage of the same image and saving storage space for the container engine and container warehouse.
[0038] In some embodiments, after locally querying the image layer file corresponding to the first image manifest (i.e., step S12), the container image processing method further includes the following steps: if the image processing device does not store the image layer file corresponding to the first image manifest, obtaining the image layer file from the first container device and storing the image layer file on the image processing device; and returning an image storage response to the first container device so that the first container device can call the image layer file.
[0039] In some embodiments, a corresponding call count parameter is configured for the first target image. That is, in the embodiments of the present disclosure, a call count parameter is configured for each target image. The call count parameter is a variable used to record the number of times the image layer file of the corresponding target image is called. The initial value of the call count parameter is 0.
[0040] As shown in FIG2 , after locally querying the image layer files corresponding to the first image manifest (i.e., step S12), the container image processing method further includes step S13': incrementing the value of a call count parameter of the first target image by 1. The call count parameter is used to record the number of times the container device has called the image layer files of the target image from the image processing device. This facilitates the image processing device's management of the image layer files, ensuring that image layer files can only be deleted if they have not been called by the container device, thereby ensuring the correctness of the container device's calls to the image layer files.
[0041] It should be noted that the execution order of step S13' and step S13 is not limited, and they can be executed simultaneously with step S13.
[0042] In some embodiments, as shown in FIG3 , after adding 1 to the value of the call count parameter of the first target image (ie, step S13 ′), the container image processing method further includes the following steps S21 to S22 .
[0043] In step S21 , a second image storage request sent by a second container device is received, and a second image list of a second target image carried in the second image storage request is obtained, wherein the second container device is different from the first container device.
[0044] In the embodiment of the present disclosure, the second container device is a container warehouse. In this step, the container warehouse sends a second image storage request to the image processing device, and the image processing device obtains the second image list of the second target image carried in the second image storage request to determine the target image requested by the container warehouse.
[0045] In step S22 , if the second target image is the same as the first target image, the value of the call count parameter of the first target image is increased by 1.
[0046] If the second target image is the same as the first target image, it means that the target image requested by the container repository is the first target image that the container engine has previously called from the image processing device. Therefore, the value of the call count parameter of the first target image can be increased by 1. That is, after executing step S22, the value of the call count parameter of the first target image can be at least 2.
[0047] It should be noted that if the second target image is different from the first target image, it means that the target image requested by the container repository is not the first target image that the container engine has called before. That is, at this time, the container device is calling the second target image for the first time. Therefore, the value of the call count parameter of the second target image can be increased by 1. After executing step S22, the value of the call count parameter of the second target image can be 1.
[0048] In some embodiments, as shown in FIG4 , when the second target image is the same as the first target image, after adding 1 to the value of the call count parameter of the first target image (i.e., step S22 ), the container image processing method may further include the following steps S31 to S36 .
[0049] In step S31 , an image deletion request sent by the first container device or the second container device is received, and a third image list of the third target image carried in the image deletion request is obtained.
[0050] In this step, the container engine or container repository sends an image deletion request to the image processing device. The image processing device obtains the third image list of the third target image carried in the image deletion request to determine the target image requested to be deleted by the container device.
[0051] In step S32 , when the third target image is the same as the first target image, the value of the call count parameter of the first target image is reduced by 1.
[0052] If the third target image is the same as the first target image, it means that the target image requested to be deleted by the container device is the first target image that the container device has previously called. Therefore, the value of the call count parameter of the first target image can be reduced by 1.
[0053] In step S33, it is determined whether the value of the call count parameter of the first target image is 0. If the value of the call count parameter of the first target image is 0, step S34 is executed; if the value of the call count parameter of the first target image is not 0, step S36 is executed.
[0054] If the value of the current call count parameter is 0, it means that the current target image (i.e., the first target image) has not been called by other container devices. At this time, the image processing device can delete the layer files of the first target image; if the value of the current call count parameter is not 0, it means that the current target image (i.e., the first target image) is still being called by other container devices. At this time, the image processing device cannot delete the layer files of the first target image.
[0055] In step S34, the image layer file of the first target image is deleted.
[0056] In this step, the image processing device locally deletes the image layer files of the first target image. At this time, the layer files of the first target image are actually deleted.
[0057] In step S35 , an image deletion response is returned to the first container device or the second container device, so that the first container device or the second container device can delete the first image manifest and configuration file of the first target image.
[0058] In this step, after locally deleting the image layer files of the first target image, the image processing device returns an image deletion response to the container device that sent the image deletion request, so that the container device locally deletes the related files of the first target image.
[0059] In step S36 , an image deletion response is returned to the first container device or the second container device, so that the first container device or the second container device can delete the first image manifest and configuration file of the first target image.
[0060] In this step, when the image processing device determines that the value of the call count parameter of the first target image is not 0, although the image processing device does not delete the image layer files of the first target image locally, the image processing device will still return an image deletion response to the container device that sent the image deletion request, so that the container device can delete the relevant files of the first target image locally.
[0061] As shown in FIG5 , an embodiment of the present disclosure further provides a container image processing method, which is applied to a container device and includes the following steps S41 to S43 .
[0062] In step S41, the image list and configuration file of the target image are stored.
[0063] When a target image needs to be imported into a container device, the image manifest and configuration file of the target image that occupies a smaller space are first stored in the container device, wherein the configuration file (config) is used to describe configuration information of the image.
[0064] In step S42, an image storage request carrying an image list is sent to the image processing device.
[0065] In step S43, the image storage response returned by the image processing device is received, and the image layer file is called from the image processing device.
[0066] The image processing device will send an image storage response only when it determines that the image layer file of the target image has been stored locally. Therefore, once the container device receives the image storage response returned by the image processing device, it can call the image layer file from the image processing device.
[0067] The container device includes a first container device or a second container device. When the container device is the first container device, the target image is the first target image, the image manifest is the first image manifest, and the image storage request is the first image storage request. When the container device is the second container device, the target image is the second target image, the image manifest is the second image manifest, and the image storage request is the second image storage request. In the embodiment of the present disclosure, the first container device may be a container engine, and the second container device may be a container repository.
[0068] According to the container image processing method provided by the embodiment of the present disclosure, an image processing device is used to store image layer files. The container engine and / or container warehouse initiate an image storage request to the image processing device. When the image processing device stores image layer files, the container engine and container warehouse can directly access the image processing device and reuse the same image layer files. There is no need to re-store the image layer files in the image processing device, thus avoiding duplicate storage and wasting storage space. In addition, there is no need to store image layer files separately in the container engine and container warehouse, thereby solving the problem of redundant storage of the same image and saving storage space for the container engine and container warehouse.
[0069] In some embodiments, before receiving the image storage response returned by the image processing device (i.e., step S43), the container image processing method further includes the following steps: receiving an image layer file acquisition request sent by the image processing device, and sending the image layer file corresponding to the first image manifest to the image processing device for the image processing device to store the image layer file.
[0070] In some embodiments, as shown in FIG6 , after sending the image storage request carrying the image list to the image processing device (ie, step S42 ), the container image processing method further includes the following steps S51 to S52 .
[0071] In step S51, an image deletion request carrying an image list is sent to an image processing device.
[0072] In this step, the container device sends an image deletion request carrying an image manifest to the image processing device, so as to notify the image processing device to delete the image layer file corresponding to the image manifest.
[0073] In step S52, an image deletion response returned by the image processing apparatus is received, and the image list and configuration file of the target image are deleted.
[0074] In this step, after receiving the image deletion response from the image processing device, the container device locally deletes the target image's related files, including the image manifest and configuration files. It should be noted that at this point, the target image's image layer files stored in the image processing device may have already been deleted or may be being used by other container devices and not yet deleted. The target image's image layer files stored in the image processing device are only truly deleted if the target image's call count parameter is 0.
[0075] To clearly illustrate the solution of the embodiment of the present disclosure, the process of importing and deleting images in the container engine and container repository is described in detail below with reference to specific examples.
[0076] Initially, the number of image-related files stored by the container engine and the container repository is zero. New images can be imported into the container engine or pushed to the container repository. Figure 7 is a schematic diagram of a container engine importing an image, provided by a specific example of the present disclosure. As shown in Figure 7, taking the case of a container engine importing a new image A as an example, the container engine first stores the image manifest and configuration file of image A, which occupies a relatively small space, within the container engine. When an image layer file needs to be loaded, the container engine sends a first image storage request to the image processing device, instructing the image processing device to determine whether the image layer file for image A is already stored. The image processing device locally queries the image layer file corresponding to image A's image manifest. If it exists, the value of the call count parameter for image A is incremented by 1. If not, the image processing device retrieves and saves the image layer file for image A from the container engine and increments the value of the call count parameter for image A by 1. In either case, the value of the call count parameter for image A is at least 1. The image processing device returns an image storage response to the container engine. When the container engine starts the container, it calls the image layer file for image A required to start the container from the image processing device using the image manifest and configuration file stored by the container engine.
[0077] FIG8 is a schematic diagram of a container repository importing an image provided by a specific example of the present disclosure. As shown in FIG8 , when the container repository receives a push request for image A, it first stores the image manifest and configuration file of image A locally in the container repository. The container repository then sends a second image storage request to the image processing device to notify the image processing device to determine whether the image layer file of image A has been stored. The image processing device locally queries the image layer file corresponding to the image manifest of image A. If it exists, the value of the call count parameter of image A is increased by 1. At this time, the value of the call count parameter of image A is at least 2, and the image processing device does not re-acquire the image layer file of image A. If it does not exist, the image processing device obtains and saves the image layer file of image A from the container repository, and increases the value of the call count parameter of image A by 1. At this time, the value of the call count parameter of image A is 1. The image processing device returns an image storage response to the container repository, and the container repository can call the image layer file of image A from the image processing device through the stored image manifest and configuration file.
[0078] FIG9 is a schematic diagram of a container engine deleting an image provided by a specific example of the present disclosure. As shown in FIG9 , when the container engine deletes image A, it sends an image deletion request carrying the image manifest of image A to the image processing device to notify the image processing device to delete the image layer file of image A. The image processing device decrements the value of the call count parameter of image A by 1. If the value of the call count parameter of image A is not 0, the image processing device will not delete the image layer file of image A locally, but will return an image deletion response to the container engine, and the container engine will delete the image manifest and configuration file of image A stored thereon; if the value of the call count parameter of image A decremented by 1 by the image processing device is 0, the image processing device will delete the image layer file of image A locally and return an image deletion response to the container engine, and the container engine will delete the image manifest and configuration file of image A stored thereon.
[0079] FIG10 is a schematic diagram of a container repository deleting an image provided by a specific example of the present disclosure. As shown in FIG10 , when the container repository deletes image A, an image deletion request carrying the image manifest of image A is sent to the image processing device to notify the image processing device to delete the image layer file of image A. The image processing device decrements the value of the call count parameter of image A by 1. If the value of the call count parameter of image A is not 0, the image processing device will not delete the image layer file of image A locally, but will return an image deletion response to the container repository, and the container repository will delete the image manifest and configuration file of image A stored thereon; if the value of the call count parameter of image A decremented by 1 by the image processing device is 0, the image processing device will delete the image layer file of image A locally and return an image deletion response to the container repository, and the container repository will delete the image manifest and configuration file of image A stored thereon.
[0080] An embodiment of the present disclosure further provides an image processing device, comprising: one or more processors and a storage device, wherein the storage device stores one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the container image processing method provided in the aforementioned embodiments.
[0081] An embodiment of the present disclosure further provides a container device, comprising: one or more processors and a storage device, wherein the storage device stores one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the container image processing method provided in the aforementioned embodiments.
[0082] An embodiment of the present disclosure further provides a computer-readable medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the processor implements the container image processing method provided in the aforementioned embodiments.
[0083] The embodiment of the present disclosure further provides a container system, including: an image processing device, a first container device, and a second container device. The first container device is a container engine, and the second container device is a container warehouse.
[0084] In some embodiments, as shown in Figure 11, the image processing device, the first container device, and the second container device are all separately provided. In this case, the image processing device stores the image layer files separately. Furthermore, the image processing device can also be integrated with the container engine or container repository, similarly enabling the container engine and container repository to share image layer files and save storage space. Therefore, in some embodiments, as shown in Figures 12 and 13, the image processing device is integrated into the container engine or container repository.
[0085] In some embodiments, as shown in Figures 11 to 14, the container system further includes an image storage device. As shown in Figure 11, the image storage device can be provided separately; or, as shown in Figures 12 and 13, the image storage device can be integrated into the container repository or container engine; or, as shown in Figure 14, the image storage device can include at least two image storage units, with different image storage units distributed on different physical nodes. In this way, image layer files can be stored on different physical nodes, while the image storage device logically forms a storage pool to achieve distributed storage of image layer files.
[0086] In response to the problem of repeated storage of the same image in the container engine and the container repository, the disclosed embodiment proposes a solution to save storage space for the container engine and the container repository. Specifically, the disclosed embodiment proposes an image layer file sharing architecture, which changes the storage method of the container engine and the container repository images that are stored separately, and uses an image processing device to enable the container engine and the container repository to share the image layer files of the same image. Under this image layer file sharing architecture, the container engine and the container repository's access to the image layer files is achieved through the image processing device. The disclosed embodiment also proposes a container image processing method, which uses the image processing device to manage the image layer files based on the call count parameters of the image, and adapts to operations such as importing and deleting images of the container engine and the container repository.
[0087] It will be appreciated by those skilled in the art that all or some of the steps in the method disclosed above, and the functional modules / units in the device can be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As is well known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media generally embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0088] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for purposes of limitation. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly indicated, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, it will be understood by those skilled in the art that various changes in form and detail may be made without departing from the scope of the invention as set forth in the appended claims.
Claims
1. A container image processing method, applied to an image processing device, the method comprising: Receive a first image storage request sent by a first container device, and obtain a first image list of a first target image carried in the first image storage request; Querying locally the image layer file corresponding to the first image list; In a case where the image processing device stores an image layer file corresponding to the first image manifest, an image storage response is returned to the first container device so that the first container device calls the image layer file.
2. The method of claim 1, wherein: After locally querying the image layer file corresponding to the first image list, the method further includes: When the image processing device does not store an image layer file corresponding to the first image list, obtaining the image layer file from the first container device and storing the image layer file in the image processing device; An image storage response is returned to the first container device so that the first container device calls the image layer file.
3. The method according to claim 1 or 2, wherein: The first target image is configured with a corresponding call count parameter, and after locally querying the image layer file corresponding to the first image manifest, the method further includes: The value of the call count parameter of the first target image is increased by 1.
4. The method of claim 3, wherein: After adding 1 to the value of the call count parameter of the first target image, the method further includes: receiving a second image storage request sent by a second container device, and obtaining a second image list of a second target image carried in the second image storage request, wherein the second container device is different from the first container device; If the second target image is the same as the first target image, The value of the call count parameter of the first target image is increased by 1.
5. The method of claim 4, wherein: In the case where the second target image is the same as the first target image, after adding 1 to the value of the call count parameter of the first target image, the method further includes: receiving an image deletion request sent by the first container device or the second container device, and obtaining a third image list of the third target image carried in the image deletion request; When the third target image is the same as the first target image, reducing the value of the call count parameter of the first target image by 1; When the value of the call count parameter is 0, delete the image layer file; An image deletion response is returned to the first container device or the second container device, so that the first container device or the second container device can delete the first image manifest and the configuration file of the first target image.
6. The method of claim 5, wherein: After reducing the value of the call count parameter of the first target image by 1, the method further includes: When the value of the call count parameter is not 0, the image layer file is not deleted, and an image deletion response is returned to the first container device or the second container device so that the first container device or the second container device can delete the first image manifest and configuration file of the first target image.
7. A container image processing method, applied to a container device, the method comprising: Stores the image list and configuration files of the target image; Sending an image storage request carrying the image list to an image processing device; receiving an image storage response returned by the image processing device, and calling the image layer file from the image processing device; The container device includes a first container device or a second container device. When the container device is the first container device, the target image is a first target image, the image list is a first image list, and the image storage request is a first image storage request. ask; in When the container device is a second container device, the target image is a second target image, the image list is a second image list, and the image storage request is a second image storage request.
8. The method of claim 7, wherein: Before receiving the image storage response returned by the image processing device, the method further includes: An image layer file acquisition request sent by the image processing device is received, and an image layer file corresponding to the first image list is sent to the image processing device, so that the image processing device stores the image layer file.
9. The method according to claim 7 or 8, wherein: After sending the image storage request carrying the image list to the image processing device, the method further includes: Sending an image deletion request carrying the image list to the image processing device; An image deletion response returned by the image processing device is received, and an image list and a configuration file of the target image are deleted.
10. An image processing device, comprising: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the container image processing method according to any one of claims 1 to 6.
11. A container device comprising: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the container image processing method according to any one of claims 7 to 9.
12. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the processor implements the container image processing method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Method and device for sharing container mirror image by physical machine, equipment and storage medium
CN110704162A
Data transmission method and device, electronic equipment, medium and computer program product
CN112671892A
Machine learning container mirror image downloading system and method for Internet of Things
CN115543538A
File Deduplication using Copy-on-Write Storage Tiers
US20090204650A1
