A method, device, equipment and storage medium for processing information of container engine docker
By obtaining and recording the number of storage layers of the mirror when the workspace of the docker container engine is started, determining the number of savings and giving prompts, the problem that the docker container engine cannot save when the number of storage layers exceeds 127 layers is solved, and user data is avoided.
Patent Information
- Application Number
- CN202110600411.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-31
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2041-05-31
AI Technical Summary
The existing docker container engine cannot save when the number of images saved exceeds 127 layers, and the lack of layer limit prompts, resulting in the user's last modification being unable to save, causing unnecessary losses.
When the workspace of the target image is started, the current storage layer information is obtained and recorded in the database, and the number of savings can be determined based on the information in the database, and corresponding prompts are given.
By prompting the user for the current use of the number of mirrored layers, avoiding the problem that the user cannot save the last modification due to the upper limit of the number of layers, ensuring the security of user data.
Smart Images

Figure CN113342362B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of container engines, and in particular to an information processing method, device, equipment and storage medium for a container engine Docker. Background Art
[0002] In the existing workspace based on Docker, the user's workspace can be saved, and the modified container will be made into an image and uploaded to the cloud storage. The next time the user starts, the modified image will be used to work.
[0003] Since Docker itself has a fixed limit on the number of saved layers (image storage layers) (currently 127), if the number of saved layers exceeds the limit, the modified content cannot be saved. And since there is no information about the limit on saving, the user's last modification cannot be saved, causing unnecessary losses. Summary of the invention
[0004] On one hand, the present invention provides an information processing method for a container engine docker, the method comprising: when a workspace corresponding to a target image is in a startup state, obtaining current storage layer number information of the target image; recording the obtained current storage layer number information to a database; based on the current storage layer number information in the database, determining the number of times the target image can be saved; and giving corresponding prompts based on the determined number of times that can be saved.
[0005] In one possible implementation, obtaining the current storage layer number information of the target image includes at least one of the following: parsing the current storage layer number information of the root file system RootFS in the metadata of the target image; or, parsing the current storage layer number information in the lower directory lowerdir file in the metadata; or, obtaining the current storage layer number information from the image repository corresponding to the target image.
[0006] In one possible implementation, before obtaining the current storage layer number information of the target image, the method also includes: sending a request to obtain relevant resources of the workspace; based on the relevant resources, determining the corresponding container instantiation of the target image; and obtaining the current storage layer number information of the target image.
[0007] In one possible implementation, before determining the number of times the target image can be saved based on the current storage layer number information in the database, the method further includes: updating the working state of the workspace to a running state.
[0008] In one possible implementation, the method further includes: when the workspace corresponding to the target image is in the process of being closed, sending request information representing the closing of a container, wherein the request information is used to update the target image based on the container; obtaining current storage layer number information of the updated target image; recording the obtained current storage layer number information to the database; and saving the target image to an image repository.
[0009] In one possible implementation, after obtaining the current storage layer number information of the updated target image, the method further includes: changing the working state of the workspace to a stopping state; correspondingly, after saving the target image to the image repository, the method further includes: changing the working state of the workspace to a stopped state.
[0010] In one possible implementation, before the workspace corresponding to the target image is in the process of being closed, the method further includes: determining whether the number of save times of the target image has reached an upper limit based on the current storage layer number information in the database; if it is determined that the number of save times of the target image has reached the upper limit, no image save operation is performed; and displaying prompt information indicating that no image save operation is performed.
[0011] On the other hand, the present invention provides an information processing device for a container engine docker, the device comprising: an image layer number acquisition module, used to obtain the current storage layer number information of the target image when the workspace corresponding to the target image is in the startup state; an image layer number recording module, used to record the acquired current storage layer number information to a database; a saved layer number judgment module, used to determine the number of times the target image can be saved based on the current storage layer number information in the database; an image layer number feedback module, used to give corresponding prompts based on the determined number of times that can be saved.
[0012] On the other hand, the present invention provides an information processing device for a container engine docker, the device comprising a memory and a processor; the memory is used to store instructions, and the instructions are used to control the processor to operate to implement any of the above-mentioned information processing methods for the container engine docker when executed.
[0013] Another aspect of the present invention provides a computer storage medium, which includes a group of computer executable instructions, and when the instructions are executed, is used to execute the information processing method of the container engine docker described in any one of the above.
[0014] In an embodiment of the present invention, by obtaining the current storage layer number information of the target image after the workspace is started, and recording the obtained current storage layer number information to the database, the workspace can interact with the database to obtain the number of times the target image can be saved, and give corresponding prompts based on the number of times it can be saved. The user can know the layer usage of the target image according to the prompt given, so as to avoid unnecessary losses caused by the user's last modification failing to be saved. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, in which:
[0016] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.
[0017] Figure 1 This is a schematic diagram of the implementation flow of an information processing method of a container engine docker according to an embodiment of the present invention;
[0018] Figure 2 This is a flow chart of the execution process of a container engine docker in the startup state according to an embodiment of the present invention;
[0019] Figure 3 It is a flowchart of the execution process of obtaining the current storage layer number information in the startup state of a container engine docker according to an embodiment of the present invention;
[0020] Figure 4 This is a flowchart of the execution process of a container engine docker shutdown process according to an embodiment of the present invention;
[0021] Figure 5 This is a schematic diagram of the structural composition of an information processing device of a container engine docker according to an embodiment of the present invention. DETAILED DESCRIPTION
[0022] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0023] Combination Figure 1 and Figure 2 As shown, the present invention provides, on one hand, a method for processing information of a container engine docker, the method comprising:
[0024] Step 101, when the workspace corresponding to the target image is in the startup state, obtain the current storage layer number information of the target image;
[0025] Step 102, recording the acquired current storage layer number information into a database;
[0026] Step 103, based on the current storage layer number information in the database, determine the number of times the target image can be saved;
[0027] Step 104: Based on the determined number of possible save times, a corresponding prompt is given.
[0028] In this embodiment, in step 101, the target image is the base image to be called, and the corresponding workspace is created based on the current target image. After the workspace of the target image is started, the current storage layer number information of the target image is obtained, wherein the current storage layer number information can be obtained by sending a request for basic image analysis to the image analyzer through the workspace controller Workspacecontroller, and the image analyzer Image analyzer responds to the request and obtains the current storage layer number information of the target image.
[0029] In step 102, after the image analyzer obtains the current storage layer number information, it saves the current storage layer number information into a database, wherein the database may be a local database or a cloud database.
[0030] In step 103, after the current storage layer number information is saved to the database, the current storage layer number information in the database can be obtained through the workspace portal, and the number of times the target image can be saved can be determined based on the total number of times the target image can be saved (generally 127 layers).
[0031] In step 104, after the determined number of possible saves, a corresponding prompt may be given to the user to inform the current usage of the image layers. The prompt information may be the number of saved layers that have been used by the target image, the remaining number of saves, etc. It may also be a notification that the target image can no longer be saved when the current number of saved layers reaches the upper limit. The notification method may be a pop-up window in the work interface or a voice notification.
[0032] Therefore, by obtaining the current storage layer number information of the target image after the workspace is started and recording the obtained current storage layer number information to the database, the workspace can interact with the database to obtain the number of times the target image can be saved, and give corresponding prompts based on the number of times it can be saved. The user can know the layer usage of the target image according to the prompts given to avoid unnecessary losses caused by the user's last modification not being able to be saved.
[0033] In one possible implementation, obtaining the current storage layer number information of the target image includes at least one of the following:
[0034] Parse the current storage layer number information of the root file system RootFS in the metadata of the target image;
[0035] Or, parse the current storage layer number information in the lowerdir file in the metadata;
[0036] Or, obtain the current storage layer number information from the image repository corresponding to the target image.
[0037] In this embodiment, combined with Figure 3 As shown, the way to obtain the current storage layer number information of the target image in step 101 includes:
[0038] 1. The user can send a request to obtain the current storage layer number information to the workspace controller Workspacecontroller through the workspace portal interface, where the workspace controller Workspacecontroller is pre-located in the master node pre-set by docker.
[0039] In response to the request, the workspace controller sends a related instruction to the image analyzer, and the image analyzer responds to the related instruction to parse the current storage layer number information of the root file system RootFS in the metadata of the target image.
[0040] 2. If the image analyzer fails to analyze, the current storage layer number information in the lowerdir file in the metadata is further analyzed.
[0041] 3. If both of the above two methods fail to analyze the image, it means that the local storage information is damaged. You can obtain the current storage layer information from the image store.
[0042] After the image analyzer obtains the current storage layer number information, the current storage layer number information can be recorded in the database so that the user can interact with the database information through the workspace portal.
[0043] In one possible implementation, before obtaining the current storage layer number information of the target image, the method further includes:
[0044] Send a request to obtain the relevant resources of the workspace;
[0045] Based on the relevant resources, determine the corresponding container instantiation of the target image;
[0046] Get the current storage layer number information of the target image.
[0047] In this embodiment, during the startup process of the workspace, it is necessary to send a resource acquisition request to the master node Masternode through the docker scheduler, and obtain relevant resources corresponding to the workspace through the master node Masternode, where the relevant resources include image services, dependent libraries, etc.
[0048] Using relevant resources, users create corresponding container instances based on the target image;
[0049] After the corresponding container instantiation is created, the current storage layer number information of the target image is obtained.
[0050] In one possible implementation, before determining the number of times the target image can be saved based on the current storage layer number information in the database, the method further includes:
[0051] Update the workspace's working status to running.
[0052] In this embodiment, combined with Figure 2 As shown, the update of the working status of the workspace is performed by the image analyzer Imageanalyzer sending a notification completion instruction to the workspace controller Workspacecontroller after recording the current storage layer number information into the database. The workspace controller Workspace controller receives and responds to the instruction to update the working status of the workspace portal interface to the Running status.
[0053] In one embodiment, the method further comprises:
[0054] When the workspace corresponding to the target image is in the process of being closed, sending request information representing closing the container, wherein the request information is used to update the target image based on the container;
[0055] Get the current storage layer number information of the updated target image;
[0056] Record the acquired current storage layer number information into the database;
[0057] Save the target image to the image repository.
[0058] In this embodiment, combined with Figure 4 As shown, the closing operation of the workspace sends a command to close the container to the workspace controller through the user controlling the workspace portal. The workspace controller responds to the command and sends a command to the image analyzer to request to save the container. The image analyzer responds to the command to analyze the number of image layers of the current image and update the wall storage layer number information of the target image, and saves the current number of image layers obtained to the database. After that, the image analyzer saves the target image to the image warehouse Image store.
[0059] In one possible implementation, after obtaining the current storage layer number information of the updated target image, the method further includes:
[0060] Change the working state of the workspace to stopping state;
[0061] Accordingly, after saving the target image to the image repository, the method further includes:
[0062] Change the workspace's working state to stopped.
[0063] In this embodiment, still combined with Figure 4 As shown, after the Image analyzer obtains the current storage layer number information of the updated target image, the Workspace controller sends a state change instruction to the workspace portal, and the workspace portal responds to the instruction to change the working state from the Running state to the Stopping state.
[0064] After saving the target image to the image repository, the Image analyzer sends a notification message of the saving completion to the Workspace controller. After receiving the notification message, the Workspace controller closes the current container. After the current container is closed, the workspace portal changes the working state of the workspace to the Stopped state and generates corresponding prompt information for the user to view.
[0065] In one possible implementation, before the workspace corresponding to the target image is in the process of being closed, the method further includes:
[0066] Based on the current storage layer number information in the database, determine whether the number of save times of the target image has reached the upper limit;
[0067] If it is determined that the number of save times of the target image has reached the upper limit, the image save operation is not performed;
[0068] A prompt message indicating that the image saving operation is not performed is displayed.
[0069] In this embodiment, still combined with Figure 4 As shown, before issuing a request to close the container, the workspace portal obtains the current storage layer number information in the database, calculates it with the total number of saves of the target image, and verifies whether the target image has reached the upper limit of the number of saves; if the verification result indicates that the number of saves of the target image has reached the upper limit of the number of saves, Docker will not perform the image save operation, and generate corresponding prompt information to be displayed on the workspace portal to inform the user.
[0070] In summary, combined with Figure 2 As shown in the figure, the execution process when the workspace corresponding to the target image is in the startup state is as follows:
[0071] First, the user creates a workspace portal. After the creation is successful, the workspace portal sends an initialization instruction to the workspace controller.
[0072] Secondly, after the workspace controller is initialized, it starts the container corresponding to the target image. After the container is started, it sends a request for the base image to the image analyzer.
[0073] The image analyzer receives the request to obtain the current number of layers of the target image. After that, it feeds back to the workspace controller to indicate that the analysis is complete, and records the number of layers in the database DB. After receiving the message notifying completion, the workspace controller changes the working state of the workspace portal to the Running state.
[0074] After the user sends a request to the workspace portal to view the number of times that can be saved, the workspace portal obtains the number of layers from the database DB for the user to view.
[0075] In summary, combined with Figure 4 As shown in the figure, the execution process when the workspace corresponding to the target image is in the closed state is:
[0076] First, after the user sends a closing request to the workspace portal, the workspace portal obtains the current image layer number from the database DB and compares it with all the save times of the target image to verify whether the current target image can still be saved, and prompts the verification result to the user.
[0077] Secondly, the workspace portal sends an instruction to execute closing the container to the workspace controller. The workspace controller responds to the instruction by sending an instruction to request saving the container to the image analyzer, and then sends an instruction to change the workspace state to Stopping to the workspace portal.
[0078] The Image analyzer responds to the instruction to analyze and obtain the number of image layers of the target image, and records the number of image layers in the database DB, then saves the target image to the image warehouse Image store, and feeds back a completion notification message to the Workspace controller Workspace controller.
[0079] After receiving the message, the workspace controller executes the operation of closing the container and sends an instruction to change the work state to Stopped to the workspace portal.
[0080] After the status change is completed, the workspace portal displays a prompt message of the status change to the user.
[0081] Another aspect of the present invention provides an information processing device for a container engine docker, such as Figure 5 As shown, the device comprises:
[0082] The image layer number acquisition module 201 is used to obtain the current storage layer number information of the target image when the workspace corresponding to the target image is in the startup state;
[0083] The image layer number recording module 202 is used to record the acquired current storage layer number information into the database;
[0084] A storage layer number determination module 203 is used to determine the number of times the target image can be saved based on the current storage layer number information in the database;
[0085] The image layer number feedback module 204 is used to give corresponding prompts based on the determined number of possible save times.
[0086] In this embodiment, in the image layer number acquisition module 201, the target image is the base image to be called, and the corresponding workspace is created based on the current target image. When the workspace of the target image is started, the current storage layer number information of the target image is obtained, wherein the current storage layer number information can be obtained by sending a request for basic image analysis to the image analyzer through the workspace controller Workspace controller, and the image analyzer Image analyzer responds to the request and obtains the current storage layer number information of the target image.
[0087] In the image layer number recording module 202, after the image analyzer obtains the current storage layer number information, it saves the current storage layer number information into a database, wherein the database may be a local database or a cloud database.
[0088] In the saved layer number determination module 203, after the current storage layer number information is saved to the database, the current storage layer number information in the database can be obtained through the workspace portal interface, and the number of times the target image can be saved can be determined based on the total number of times the target image can be saved (generally 127 layers).
[0089] In the image layer number feedback module 204, after the number of times that can be saved is determined, a corresponding prompt can be given to the user to inform the current image layer usage. The prompt information can be to inform the target image of the number of saved layers that have been used, the remaining number of saves, etc., or it can be to inform that the target image can no longer be saved when the current number of saved layers reaches the upper limit. The notification method can be in the form of a pop-up window in the work interface or in the form of voice.
[0090] Therefore, by obtaining the current storage layer number information of the target image after the workspace is started and recording the obtained current storage layer number information to the database, the workspace can interact with the database to obtain the number of times the target image can be saved, and give corresponding prompts based on the number of times it can be saved. The user can know the layer usage of the target image according to the prompts given to avoid unnecessary losses caused by the user's last modification not being able to be saved.
[0091] In one possible implementation, the image layer number acquisition module 201 acquires the current storage layer number information of the target image by at least one of the following methods:
[0092] Parse the current storage layer number information of the root file system RootFS in the metadata of the target image;
[0093] Or, parse the current storage layer number information in the lowerdir file in the metadata;
[0094] Or, obtain the current storage layer number information from the image repository corresponding to the target image.
[0095] In this embodiment, combined with Figure 3 As shown, the image layer number acquisition module 201 acquires the current storage layer number information of the target image in the following ways:
[0096] 1. The user can send a request to obtain the current storage layer number information to the workspace controller Workspacecontroller through the workspace portal interface, where the workspace controller Workspacecontroller is pre-located in the master node pre-set by docker.
[0097] In response to the request, the workspace controller sends a related instruction to the image analyzer, and the image analyzer responds to the related instruction to parse the current storage layer number information of the root file system RootFS in the metadata of the target image.
[0098] 2. If the image analyzer fails to analyze, the current storage layer number information in the lowerdir file in the metadata is further analyzed.
[0099] 3. If both of the above two methods fail to analyze the image, it means that the local storage information is damaged. You can obtain the current storage layer information from the image store.
[0100] After the image analyzer obtains the current storage layer number information, the current storage layer number information can be recorded in the database so that the user can interact with the database information through the workspace portal.
[0101] In one possible implementation, before obtaining the current storage layer number information of the target image, the image layer number obtaining module 201 is further specifically used to:
[0102] Send a request to obtain the relevant resources of the workspace;
[0103] Based on the relevant resources, determine the corresponding container instantiation of the target image;
[0104] Get the current storage layer number information of the target image.
[0105] In this embodiment, during the startup process of the workspace, it is necessary to send a resource acquisition request to the master node Masternode through the docker scheduler, and obtain relevant resources corresponding to the workspace through the master node Masternode, where the relevant resources include image services, dependent libraries, etc.
[0106] Using relevant resources, users create corresponding container instances based on the target image;
[0107] After the corresponding container instantiation is created, the current storage layer number information of the target image is obtained.
[0108] In one possible implementation, before the storage layer number determination module 203 determines the number of times the target image can be saved based on the current storage layer number information in the database, the method further includes:
[0109] Update the workspace's working status to running.
[0110] In this embodiment, combined with Figure 2As shown, the update of the working status of the workspace is performed by the image analyzer Imageanalyzer sending a notification completion instruction to the workspace controller Workspacecontroller after recording the current storage layer number information into the database. The workspace controller Workspace controller receives and responds to the instruction to update the working status of the workspace portal interface to the Running status.
[0111] In one possible implementation, the image layer number feedback module 204 is further specifically used for:
[0112] When the workspace corresponding to the target image is in the process of being closed, sending request information representing closing the container, wherein the request information is used to update the target image based on the container;
[0113] Get the current storage layer number information of the updated target image;
[0114] Record the acquired current storage layer number information into the database;
[0115] Save the target image to the image repository.
[0116] In this embodiment, combined with Figure 4 As shown, the closing operation of the workspace sends a command to close the container to the workspace controller through the user controlling the workspace portal. The workspace controller responds to the command and sends a command to the image analyzer to request to save the container. The image analyzer responds to the command to analyze the number of image layers of the current image and update the wall storage layer number information of the target image, and saves the current number of image layers obtained to the database. After that, the image analyzer saves the target image to the image warehouse Image store.
[0117] In one possible implementation, after obtaining the current storage layer number information of the updated target image, the image layer number feedback module 204 is further specifically used to:
[0118] Change the working state of the workspace to stopping state;
[0119] Accordingly, after saving the target image to the image repository, the method further includes:
[0120] Change the workspace's working state to stopped.
[0121] In this embodiment, still combined with Figure 4 As shown, after the Image analyzer obtains the current storage layer number information of the updated target image, the Workspace controller sends a state change instruction to the workspace portal, and the workspace portal responds to the instruction to change the working state from the Running state to the Stopping state.
[0122] After saving the target image to the image repository, the Image analyzer sends a notification message of the saving completion to the Workspace controller. After receiving the notification message, the Workspace controller closes the current container. After the current container is closed, the workspace portal changes the working state of the workspace to the Stopped state and generates corresponding prompt information for the user to view.
[0123] In one possible implementation, before the workspace corresponding to the target image is in the closing process, the image layer number feedback module 204 is further specifically used to:
[0124] Based on the current storage layer number information in the database, determine whether the number of save times of the target image has reached the upper limit;
[0125] If it is determined that the number of save times of the target image has reached the upper limit, the image save operation is not performed;
[0126] A prompt message indicating that the image saving operation is not performed is displayed.
[0127] In this embodiment, still combined with Figure 4 As shown, before issuing a request to close the container, the workspace portal obtains the current storage layer number information in the database, calculates it with the total number of saves of the target image, and verifies whether the target image has reached the upper limit of the number of saves; if the verification result indicates that the number of saves of the target image has reached the upper limit of the number of saves, Docker will not perform the image save operation, and generate corresponding prompt information to be displayed on the workspace portal to inform the user.
[0128] In summary, combined with Figure 2 As shown in the figure, the execution process when the workspace corresponding to the target image is in the startup state is as follows:
[0129] First, the user creates a workspace portal. After the creation is successful, the workspace portal sends an initialization instruction to the workspace controller.
[0130] Secondly, after the workspace controller is initialized, it starts the container corresponding to the target image. After the container is started, it sends a request for the base image to the image analyzer.
[0131] The image analyzer receives the request to obtain the current number of layers of the target image. After that, it feeds back to the workspace controller to indicate that the analysis is complete, and records the number of layers in the database DB. After receiving the message notifying completion, the workspace controller changes the working state of the workspace portal to the Running state.
[0132] After the user sends a request to the workspace portal to view the number of times that can be saved, the workspace portal obtains the number of layers from the database DB for the user to view.
[0133] In summary, combined with Figure 4 As shown in the figure, the execution process when the workspace corresponding to the target image is in the closed state is:
[0134] First, after the user sends a closing request to the workspace portal, the workspace portal obtains the current image layer number from the database DB and compares it with all the save times of the target image to verify whether the current target image can still be saved, and prompts the verification result to the user.
[0135] Secondly, the workspace portal sends an instruction to execute closing the container to the workspace controller. The workspace controller responds to the instruction by sending an instruction to request saving the container to the image analyzer, and then sends an instruction to change the workspace state to Stopping to the workspace portal.
[0136] The Image analyzer responds to the instruction to analyze and obtain the number of image layers of the target image, and records the number of image layers in the database DB, then saves the target image to the image warehouse Image store, and feeds back a completion notification message to the Workspace controller Workspace controller.
[0137] After receiving the message, the workspace controller executes the operation of closing the container and sends an instruction to change the work state to Stopped to the workspace portal.
[0138] After the status change is completed, the workspace portal displays a prompt message of the status change to the user.
[0139] Another aspect of the present invention provides a Docker-based information processing device, the device comprising a memory and a processor;
[0140] The memory is used to store instructions, and the instructions are used to control the processor to operate to implement any Docker-based information processing method when executing.
[0141] In this embodiment, the memory is used to store instructions, and when the storage instructions are executed, it is used to: when the workspace corresponding to the target image is in the startup state, obtain the current storage layer number information of the target image; record the obtained current storage layer number information to the database; based on the current storage layer number information in the database, determine the number of times the target image can be saved; based on the determined number of times that can be saved, give corresponding prompts.
[0142] Therefore, by obtaining the current storage layer number information of the target image after the workspace is started and recording the obtained current storage layer number information to the database, the workspace can interact with the database to obtain the number of times the target image can be saved, and give corresponding prompts based on the number of times it can be saved. The user can know the layer usage of the target image according to the prompts given to avoid unnecessary losses caused by the user's last modification not being able to be saved.
[0143] Another aspect of the present invention provides a storage medium, which includes a set of computer executable instructions, which are used to execute a docker-based information processing method when the instructions are executed.
[0144] In this embodiment, the computer storage medium includes a set of computer executable instructions, which, when executed, are used to: obtain the current storage layer number information of the target image when the workspace corresponding to the target image is in the startup state; record the obtained current storage layer number information to the database; determine the number of times the target image can be saved based on the current storage layer number information in the database; and give corresponding prompts based on the determined number of times that can be saved.
[0145] Therefore, by obtaining the current storage layer number information of the target image after the workspace is started and recording the obtained current storage layer number information to the database, the workspace can interact with the database to obtain the number of times the target image can be saved, and give corresponding prompts based on the number of times it can be saved. The user can know the layer usage of the target image according to the prompts given to avoid unnecessary losses caused by the user's last modification not being able to be saved.
[0146] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.
[0147] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0148] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for processing information of a container engine docker, characterized in that: The method comprises: When the workspace corresponding to the target image is in the startup state, obtaining the current storage layer number information of the target image; Record the acquired current storage layer number information into the database; Determine the number of times the target image can be saved based on the current storage layer number information in the database; Based on the determined number of possible saves, a corresponding prompt is given.
2. According to the method of claim 1, the obtaining the current storage layer number information of the target image comprises at least one of the following: Parsing the current storage layer number information of the root file system RootFS in the metadata of the target image; Or, parse the current storage layer number information in the lowerdir file in the metadata; Or, obtain the current storage layer number information from the image repository corresponding to the target image.
3. According to the method of claim 1, before obtaining the current storage layer number information of the target image, the method further comprises: Sending a request to obtain relevant resources of the workspace; Determine, based on the relevant resources, a corresponding container instantiation of the target image; Obtain the current storage layer number information of the target image.
4. The method according to claim 1, before determining the number of times the target image can be saved based on the current storage layer number information in the database, the method further comprises: The working state of the workspace is updated to a running state.
5. The method according to claim 1, further comprising: When the workspace corresponding to the target image is in the process of being closed, sending request information representing closing the container, wherein the request information is used to update the target image based on the container; Get the current storage layer number information of the updated target image; Recording the acquired current storage layer number information into the database; The target image is saved in the image repository.
6. According to the method of claim 5, after obtaining the current storage layer number information of the updated target image, the method further comprises: Changing the working state of the workspace to a stopping state; Accordingly, after the target image is saved in the image repository, the method further includes: The working state of the workspace is changed to a stopped state.
7. The method according to claim 5, before the workspace corresponding to the target image is in the process of being closed, the method further comprises: Based on the current storage layer number information in the database, determining whether the number of save times of the target image has reached an upper limit; If it is determined that the number of save times of the target image has reached the upper limit, the image save operation is not performed; A prompt message indicating that the image saving operation is not performed is displayed.
8. An information processing device for a container engine docker, characterized in that: The device comprises: An image layer number acquisition module is used to obtain the current storage layer number information of the target image when the workspace corresponding to the target image is in the startup state; The image layer number recording module is used to record the acquired current storage layer number information into the database; A storage layer number determination module, used to determine the number of times the target image can be saved based on the current storage layer number information in the database; The image layer number feedback module is used to give corresponding prompts based on the determined number of possible save times.
9. An information processing device of a container engine docker, characterized in that: The device comprises a memory and a processor; The memory is used to store instructions, and the instructions are used to control the processor to operate so as to implement the information processing method of the container engine docker described in any one of claims 1-7 when executed.
10. A storage medium, characterized in that: The storage medium includes a set of computer executable instructions, which, when executed, are used to execute the information processing method of the container engine docker according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method and equipment of processing context
CN103068068A
Image formation apparatus and program
JP2018065315A