CN111666129B - Container mirror image processing method, electronic device, storage medium and system - Google Patents

Container mirror image processing method, electronic device, storage medium and system Download PDF

Info

Publication number
CN111666129B
CN111666129B CN202010495694.6A CN202010495694A CN111666129B CN 111666129 B CN111666129 B CN 111666129B CN 202010495694 A CN202010495694 A CN 202010495694A CN 111666129 B CN111666129 B CN 111666129B
Authority
CN
China
Prior art keywords
mirror image
target
container
container mirror
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010495694.6A
Other languages
Chinese (zh)
Other versions
CN111666129A (en
Inventor
贺磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kedong Guangzhou Software Technology Co Ltd
Original Assignee
Kedong Guangzhou Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kedong Guangzhou Software Technology Co Ltd filed Critical Kedong Guangzhou Software Technology Co Ltd
Priority to CN202010495694.6A priority Critical patent/CN111666129B/en
Publication of CN111666129A publication Critical patent/CN111666129A/en
Application granted granted Critical
Publication of CN111666129B publication Critical patent/CN111666129B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a container mirror image processing method, electronic equipment, a storage medium and a system, wherein the method comprises the following steps: receiving container mirror image parameters input by a user; generating a Dockerfile with adaptive target architecture according to the container mirror image parameters; calling a target virtual machine in the multiple virtual machines, constructing a target container mirror image in the target virtual machine according to the Dockerfile file, and running a compiling environment of the container mirror image of a target architecture in the target virtual machine; and responding to the container mirror image transmission operation triggered by the client, determining a target container mirror image according to metadata carried by the transmission operation, and transmitting the target container mirror image with the client. The management of the heterogeneous system container images is realized by arranging a plurality of virtual machines. The container mirror image editing function is realized through the container mirror image compiling environment provided by the virtual machine, the container mirror image transmission operation initiated by the client side can be responded, the function of providing the container mirror image matched with the client side architecture type for the client side is realized, and the heterogeneous scene container mirror image management efficiency is improved.

Description

Container mirror image processing method, electronic device, storage medium and system
Technical Field
Embodiments of the present invention relate to container mirroring technologies, and in particular, to a container mirroring method, an electronic device, a storage medium, and a system.
Background
With the continuous development of internet technology, container technology and container mirroring technology are applied. The current container and container mirror management and usage scheme runs under the same system architecture. For the case that multiple system architectures (also called heterogeneous) need to use container mirror, an efficient heterogeneous container mirror management scheme is lacking.
Disclosure of Invention
The invention provides a container mirror image processing method, electronic equipment, a storage medium and a system, which are used for improving the management efficiency of container mirror images in heterogeneous scenes.
In a first aspect, an embodiment of the present invention provides a container mirroring method, applied to a server, including:
receiving container mirror image parameters input by a user, wherein the container mirror image parameters comprise a target architecture applicable to a container;
generating a Dockerfile with adaptive target architecture according to the container mirror image parameters;
the server side comprises a plurality of virtual machines, a target virtual machine in the plurality of virtual machines is called, a target container mirror image is built in the target virtual machine according to the Dockerfile file, and a compiling environment of the container mirror image of a target architecture runs in the target virtual machine;
and responding to the container mirror image transmission operation triggered by the client, determining a target container mirror image according to metadata carried by the transmission operation, and transmitting the target container mirror image with the client.
In a second aspect, an embodiment of the present invention further provides a container mirroring method, applied to a client, including:
connecting a server side, wherein container images of various architectures are stored in the server side;
and initiating a transmission operation of the target container mirror image to the server side, and performing target container mirror image transmission with the server side, wherein the transmission operation comprises metadata, and the target container mirror image is a container mirror image under a target architecture.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
a storage device for storing 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 mirroring method according to the embodiment of the present application.
In a fourth aspect, the present invention further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are used to perform the container mirroring processing method according to the embodiment of the present application.
In a fifth aspect, an embodiment of the present invention further provides a container mirroring processing system, including: a server side and a client side;
the server receives container mirror image parameters input by a user, wherein the container mirror image parameters comprise a target architecture applicable to a container; generating a Dockerfile with adaptive target architecture according to the container mirror image parameters; the server side comprises a plurality of virtual machines, a target virtual machine in the plurality of virtual machines is called, a target container mirror image is built in the target virtual machine according to the Dockerfile file, and a compiling environment of the container mirror image of a target architecture runs in the target virtual machine;
the client is connected with the server, and container images with various architectures are stored in the server; initiating a container mirror image transmission operation to a server side, wherein the transmission operation comprises metadata;
and the server side responds to the container mirror image transmission operation triggered by the client side, determines a target container mirror image according to metadata carried by the transmission operation, and transmits the target container mirror image with the client side, wherein the target container mirror image is a container mirror image under a target architecture.
According to the container mirror image processing scheme provided by the embodiment of the application, management of container mirror images of the heterogeneous system is achieved by arranging the virtual machines. The method comprises the steps of generating a Dockerfile file by receiving a container image parameter under a target architecture input by a user, and constructing a target container image according to the Dockerfile file in a virtual machine, so as to realize the editing function of the container image through a container image compiling environment provided by the virtual machine. Meanwhile, the container mirror image transmission operation initiated by the client can be responded, the function of providing the container mirror image matched with the architecture type of the client for the client is realized, and the management efficiency of the container mirror image in the heterogeneous scene is improved.
Drawings
FIG. 1 is a diagram illustrating a container mirroring architecture according to an embodiment of the invention;
FIG. 2 is a flowchart of a container mirroring method according to a first embodiment of the present invention;
FIG. 3 is a flowchart of a container mirroring method according to a second embodiment of the present invention;
FIG. 4 is a flowchart of a container mirroring method according to a third embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a container mirror image processing apparatus according to a fifth embodiment of the present invention;
FIG. 6 is a schematic structural diagram of a container mirror image processing apparatus according to a sixth embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device in a seventh embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Fig. 1 is a schematic diagram of a container mirroring architecture according to an embodiment of the present disclosure, which includes a server 101 and a plurality of clients 102 respectively deployed with different system architectures. Different system architectures include X86, ARM64, or ARM v7, among others. A plurality of virtual machines are maintained in the server side 101, and each virtual machine includes a compilation environment of a container image of a certain system architecture. Multiple virtual machines may be configured for multiple system architectures, each system architecture configured with one or more virtual machines. The user may log into the server side 101 and input container image parameters, which include the target architecture and configuration information for constructing the container image. After a user logs in the server 101, the user may select a target architecture, input configuration information for constructing a container mirror image, the server 101 generates a Dockerfile adapted to the target architecture according to the configuration information, and then generates the container mirror image of the target architecture according to the Dockerfile in a virtual machine corresponding to the target architecture. The editing function of container mirroring in the server side 101 is realized. Meanwhile, the server 101 may mark the container images of different architectures through metadata such as tag, and the like, so as to store and manage the different container images of different architectures. After the client 102 connects to the server 101, the transmission operation of the container image may be performed with the server 101, where the transmission operation includes a pull operation or an upload operation. The server side 101 may be regarded as a container mirror repository, providing the client side 102 with the pull function of the container mirror. Meanwhile, the client 102 may also send the container image to the server 101 to expand the container image in the container image repository. The server 101 can accurately mark container images of different operating systems of different architectures through metadata, so as to achieve the effect of managing the container images belonging to different architectures in a heterogeneous scene. The above scheme is specifically illustrated by the following examples:
example one
Fig. 2 is a flowchart of a container mirror processing method provided in this embodiment, where this embodiment is applicable to a situation where a server and a client pull and upload a container mirror and a server edits a container mirror provided by the server, and the method may be executed by the server, and specifically includes the following steps:
step 110, receiving container mirror image parameters input by a user, wherein the container mirror image parameters comprise a target architecture suitable for the container.
The user can access the server side according to the network address and the port of the server side. Optionally, the user may use the terminal to send the container mirroring parameter to the server, and at this time, the server receives the container mirroring parameter sent by the user through the terminal. Optionally, the user may also log in the server side, and input the container mirroring parameter in the server side. Optionally, the user may also access the server side through the client side.
The container mirror image parameters comprise a target architecture and configuration information used for constructing the container mirror image, and the container mirror image parameters are used for constructing the container mirror image which conforms to the configuration information under the target architecture. In a heterogeneous scenario, a server needs to maintain container images under different architectures, so that container image parameters need to specify a target architecture in addition to general configuration information required when constructing the container images, and the target architecture is used to represent an architecture used by the container images. The architecture includes X86, ARM v7, ARM64, and the like.
And 120, generating a Dockerfile with the adaptive target architecture according to the container mirror image parameters.
And after receiving the container mirror image parameters, determining a Dockerfile format adapted to the target architecture according to the target architecture. And generating a Dockerfile matched with the target architecture by using the configuration information. The Dockerfile file is a file that consists of command statements and supports annotation lines that begin with "#". The content of the Dockerfile file may include: basic mirror image information, maintainer information, mirror image operation instructions and container execution instructions when starting. The Dockerfile file may be generated using the base image information, the maintainer information, the image operation instructions, and the execution instructions at startup of the container included in the configuration information.
Step 130, the server side comprises a plurality of virtual machines, a target virtual machine in the plurality of virtual machines is called, a target container mirror image is built in the target virtual machine according to the Dockerfile file, and a compiling environment of the container mirror image of the target architecture runs in the target virtual machine.
Each architecture requires independent system environment support, and virtual machines can provide different architected compilation environments. One or more virtual machines may be pre-built for each architecture, for example, prior to step 110. With the increase of the number of the virtual machines, the requirement of multi-user parallel response can be better met. The server side can manage the virtual machines constructed under each architecture. For example, virtual machine allocation is performed according to management information such as the current load condition of the virtual machine and the computing capacity of the virtual machine.
According to the target architecture, a plurality of virtual machines built under the target architecture can be determined. One virtual machine can be randomly selected from a plurality of virtual machines constructed under the target architecture to serve as the target virtual machine. Or the target virtual machine can be determined according to a certain selection rule by searching according to the management information. The selection rules may be, but are not limited to: and using the virtual machine with the strongest current computing capability as a target virtual machine, or preferentially using the running virtual machine as the target virtual machine, and the like.
In the target virtual machine, the target container mirror image is constructed by using the Dockerfile generated in step 120, so as to obtain the target container mirror image of the target architecture. The user, by accessing the server, can construct a new target container image by generating a new Dockerfile file. Or reading the generated Dockerfile, modifying the Dockerfile through an access server, and then constructing a modified target container mirror image by using the modified Dockerfile in the target virtual machine. The functions of creating and modifying container images with various architectures are realized by managing a virtual machine of a compiling environment in which container images with different architectures are operated.
And 140, responding to the container mirror image transmission operation triggered by the client, determining a target container mirror image according to metadata carried by the transmission operation, and transmitting the target container mirror image with the client.
The transmission operation includes a pull operation or an upload operation. The pulling operation can be understood as: and the client pulls the operation of a certain container mirror image with the same structure as the client from the server. The upload operation may be understood as: and the client side sends a certain container image local to the client side to the server side. After the client uploads the container mirror image to the server through the uploading operation, the server can manage the container mirror image.
In one implementation, if the transmission operation is a pull operation, step 140 may be implemented by:
responding to a pulling operation sent by a client, wherein the pulling operation carries metadata, and the metadata comprises a target architecture or a mirror image identifier; determining a target container mirror image according to the metadata; and feeding back the target container mirror image to the client.
The client can initiate a pull operation to the server through a Docker command. The Docker command carries metadata. The metadata includes a target architecture applicable to the client, and an image identification possessed by the requested target container image. The mirror identification is used to uniquely identify the container mirror. The image identifier may be a name of the target container image, and the name may include a version of the container image, an applicable operating system, and the like. The metadata further includes: basic mirror image information, construction time information or mirror image size information, and the like. The above-described metadata may be used to more accurately describe and locate the target container image. And under the target architecture according to the information search contained in the metadata, searching a container mirror image with a corresponding mirror image identifier as a target container mirror image.
For example, the server stores container images of various applications of the Windows system under the X86 architecture and container images of various applications of the Linux system. And if the target architecture in the metadata is X86, the system version is Win10 and the application version is v1.0, the target container mirror image can be accurately positioned in the server side according to the target architecture recorded by the metadata and the mirror image identification.
In another implementation, if the transmission operation is an upload operation, step 140 may be implemented by:
receiving an uploading operation sent by a client, wherein the uploading operation carries metadata and a target container mirror image, and the metadata comprises a target architecture or a mirror image identifier; and storing the mirror image of the target container, and establishing an index relationship between the metadata and the storage address of the mirror image of the target container.
The client can initiate an upload operation to the server through a Docker command. The Docker command carries metadata, and the metadata includes a target architecture or a mirror identifier. The server is configured with virtual machines for different architectures in advance, and a storage space is allocated for each virtual machine. The storage space is used for storing system data required by the running of the virtual machine. The storage space is also used for storing a target container image with the same architecture as the virtual machine. For example, the server allocates a 1TB storage space for a virtual machine, and the 1TB storage space stores not only system data required for running the virtual machine but also a target container image. The storage space may be divided into a plurality of storage areas for storing different types of data, respectively. For example, into two storage areas, one for storing system data and the other for storing the target container image.
And storing the target container mirror image in the storage space, and acquiring the storage address of the target container mirror image. And establishing an index relationship between the metadata and the storage address of the target container mirror image. Illustratively, the index relationship may be a key-value pair, (metadata a, the storage address of the target container image a). According to the storage address of the container mirror image recorded in the index relation, the target container mirror image which is consistent with the metadata description content can be searched in the storage space, and the target container mirror image can be quickly and accurately searched in the virtual machine according to the metadata.
It should be noted that step 140 may be executed after step 130, or may be executed before step 110.
When step 140 is performed after step 130, it applies to the following scenario: after a user generates or modifies a certain target container mirror image in the server side, the server side responds to the container mirror image transmission operation of the client side, for example, the pulling operation of the target container mirror image, and sends the target container mirror image to the client side. The method realizes that the server side provides the pull operation of the container mirror images under different architectures for the client side.
When step 140 can also be performed before step 110, it applies to the following scenario: after the client connects to the server, the client performs a transmission operation of the container image to the server, for example, an operation of uploading the target container image to the server. The effect that the client expands the container mirror image for the server side is achieved. After the client sends the target container mirror image to the server, the user can access the server to modify the received target container mirror image in other management modes.
In order to manage container images under different architectures more efficiently and accurately, the server records architecture information, version information and the like of the container images through metadata of the container images. And classifying and storing the container images under different architectures through the content recorded by the metadata.
Further, before step 140, the method further includes:
receiving login information sent by a client; checking according to the login information;
accordingly, in response to a client-triggered container mirror transfer operation, the method may be implemented as follows:
and if the verification is successful, responding to the container mirror image transmission operation triggered by the client.
The login information includes a user name and a password. When the server side establishes connection with the client side, the identity of the client side needs to be verified. The validity of the client identity can be determined by checking the login information. A one-to-one correspondence password may be maintained for each client. The operation authority of the client may also be determined according to the login information, for example, the client may only perform one of a pull operation and an upload operation, or the client may perform any one of a pull operation and an upload operation.
The login information sent by the client is verified, whether the client has the authority to access the server or not and whether the client has the authority of the container mirror image pull-down operation or upload operation or not can be determined, and the safety is improved.
Optionally, the client may register a target architecture, a network address, a client identifier, and the like of the client to the server in advance, and then the server may obtain an architecture suitable for a target container mirror image transmitted with the client according to the received source address of the transmission operation, that is, the network address of the client, and may not check each connection, and in a validity period after the successful check in sequence, the target container mirror image is directly transmitted based on the fact that the source address has passed the authentication, thereby reducing the links of the authentication, and improving the transmission efficiency of the target container mirror image.
According to the container mirror image processing method provided by the embodiment of the application, management of the container mirror image of the heterogeneous system is realized by arranging the plurality of virtual machines. The method comprises the steps of generating a Dockerfile file by receiving a container image parameter under a target architecture input by a user, and constructing a target container image according to the Dockerfile file in a virtual machine, so as to realize the editing function of the container image through a container image compiling environment provided by the virtual machine. Meanwhile, the container mirror image transmission operation initiated by the client can be responded, the function of providing the container mirror image matched with the architecture type of the client for the client is realized, and the management efficiency of the container mirror image in the heterogeneous scene is improved.
Example two
Fig. 3 is a flowchart of a container mirror processing method provided in the embodiment of the present application, where the method is applied to a server side, and as a further description of the embodiment, the server side may provide a visual interface for a user, so that the user can more conveniently input container mirror parameters, specifically including the following steps:
step 210, outputting options of container mirror image parameters in a visual interface, and receiving a target architecture selected by a user according to the options and first configuration information.
Wherein the first configuration information includes: a combination of one or more of the dependent base container image or container image versions.
The user can use the terminal to remotely access the container mirror image parameter setting interface of the server end according to the network address of the server end, and can also enter the container mirror image parameter setting interface after identity verification is carried out on the server end. In the container mirroring parameter setting interface, the setting of the container mirroring parameters can be provided for the user. The first configuration information is selected in a manner that a plurality of selectable options are provided for the user for each first configuration information, and each option is a selectable content of the first container image.
And step 220, receiving second configuration information input by a user in the visual interface.
Wherein the second configuration information includes: a container image description, a container image name, a software package on which the container image depends, a container run command, or a combination of one or more of container execution scripts.
The visualization interface requires the user to enter second configuration information in addition to the selectable options provided in step 210. The second configuration information may be in a text format, and the user inputs corresponding contents according to the characteristics of the container mirror image.
And step 230, generating a Dockerfile adapted to the target architecture according to the target architecture, the first configuration information and the second configuration information.
After the server side obtains the target architecture, the first configuration information and the second configuration information, according to the target architecture selected by the user, a Dockerfile file format adaptive to the target architecture is determined. And generating a Dockerfile meeting the Dockerfile file format specification according to the first configuration information and the second configuration information.
If the user needs to generate container images in the plurality of architectures respectively, first configuration information and second configuration information required by the Dockerfile file adapted to each architecture can be input through a visual interface respectively, and then virtual machines corresponding to different architectures are called to generate corresponding target container images. A plurality of windows can be displayed in the visual interface and are respectively used for a user to configure container mirror image parameters of different architectures. Illustratively, the visualization interface displays two windows in which a user can set container mirroring parameters that are suitable for use under the X86 architecture. The container mirror image parameters applicable to the X86 architecture include: first configuration information and second configuration information applicable to the X86 architecture. The user may also set container mirroring parameters in another window that are suitable for use under the ARM v7 architecture. The container mirror image parameters suitable for the ARM v7 architecture include: first configuration information and second configuration information applicable to the ARM v7 architecture.
Step 240, the server side comprises a plurality of virtual machines, a target virtual machine in the plurality of virtual machines is called, a target container mirror image is built in the target virtual machine according to the Dockerfile file, and a compiling environment of the container mirror image of the target architecture runs in the target virtual machine.
And step 250, responding to the container mirror image transmission operation triggered by the client, determining a target container mirror image according to metadata carried by the transmission operation, and transmitting the target container mirror image with the client.
The container mirror image processing method provided by the embodiment of the application can provide a visual interface at a server side, a user can select a certain option in the visual interface to determine the target architecture and the first configuration information, and the second configuration information is determined by inputting a command or information, so that the user is prevented from inputting container mirror image parameters in a code writing mode, the user can input container parameters quickly, and the usability is improved.
EXAMPLE III
Fig. 4 is a flowchart of a container mirror processing method provided in this embodiment, where this embodiment is applicable to a situation where a server and a client pull and upload a container mirror and a server edits a container mirror, and the method can be executed by the client, and specifically includes the following steps:
and step 310, connecting a server, wherein container images with various architectures are stored in the server.
Before the client side performs container image transmission on the server side, an available connection needs to be established with the server side.
Optionally, step 310 may be implemented as: and connecting the server side according to the server side address and the login information contained in the configuration file. If the connection is successful, step 320 is performed.
A configuration file is maintained in the client. The configuration file contains information required by the client when the client is connected with the server, such as the address of the server and login information. The client determines the target address of the message according to the server address, and simultaneously carries login information in the message, so that the server performs identity authentication on the login information. And the client determines whether the connection is successful according to the verification result fed back by the server.
And step 320, initiating a transmission operation of the target container mirror image to the server side, and performing target container mirror image transmission with the server side, wherein the transmission operation comprises metadata, and the target container mirror image is a container mirror image under a target architecture.
After establishing a connection with the server, the client may initiate a transfer operation to the server. The transfer operation includes a pull operation and an upload operation. The client can register a target architecture, a network address, a client identifier and the like of the client to the server in advance, and then the server can acquire the architecture suitable for the target container mirror image transmitted by the client according to the received source address of the transmission operation, namely the network address of the client, and does not need to check every connection.
In one implementation, if the transmission operation is a pull operation, step 320 may be implemented by: acquiring a target architecture of a client; initiating a pulling operation to a server, wherein the pulling operation carries metadata of a target container mirror image, and the metadata comprises a target architecture or a mirror image identifier; and receiving the target container mirror image fed back by the server side. The metadata may be recorded by tag.
The configuration file also includes the architecture adopted by the client, i.e., the target architecture. And the target mechanism of the client can be obtained by reading the configuration file. The configuration file may also record metadata of the container image that needs to be transferred in the client.
In another implementation, if the transmission operation is an upload operation, step 320 may be implemented by: determining metadata from the local target container image, the metadata comprising: a target architecture or mirror identification; and initiating an uploading operation to the server side, and sending the metadata and the local target container mirror image to the server side.
According to the container mirror image processing method provided by the embodiment of the application, the client side and the server side can perform transmission operation of the container mirror image after being connected with the server side. Because the server side stores container mirror images with different architectures, the client side can pull the target container mirror image in the target architecture from the server side according to the target architecture of the client side; meanwhile, the local target container mirror image and the metadata of the target container mirror image can be uploaded to the server, and the function of expanding the container mirror image for the server side by the client side is realized. In a heterogeneous scene, a plurality of clients can be respectively deployed with different architectures, and when container mirror image transmission is performed with a server, a target container mirror image can be accurately determined in the server through identification information such as a target architecture and a version contained in metadata, so that the clients can quickly pull and upload the container mirror image in the heterogeneous scene.
Example four
An embodiment of the present application provides a container mirror image processing system, including: a server side and a client side;
the server receives container mirror image parameters input by a user, wherein the container mirror image parameters comprise a target architecture applicable to a container; generating a Dockerfile with adaptive target architecture according to the container mirror image parameters; the server side comprises a plurality of virtual machines, a target virtual machine in the plurality of virtual machines is called, a target container mirror image is built in the target virtual machine according to the Dockerfile file, and a compiling environment of the container mirror image of a target architecture runs in the target virtual machine;
the client is connected with the server, and container images with various architectures are stored in the server; initiating a container mirror image transmission operation to a server side, wherein the transmission operation comprises metadata;
and the server side responds to the container mirror image transmission operation triggered by the client side, determines a target container mirror image according to metadata carried by the transmission operation, and transmits the target container mirror image with the client side, wherein the target container mirror image is a container mirror image under a target architecture.
In one implementation, the client performs an uploading operation of the target container image to the server in the following manner:
the client is connected with the server according to the server address and the login information contained in the configuration file;
and the server side performs identity authentication on the client side according to the login information and feeds back an identity authentication result.
When the client receives the identity authentication success message, determining metadata according to the local target container mirror image, wherein the metadata comprises: a target architecture or mirror identification; initiating an uploading operation to a server side, and sending the metadata and a local target container mirror image to a server;
the server side receives an uploading operation sent by the client side, wherein the uploading operation carries metadata and a target container mirror image, and the metadata comprises a target architecture or a mirror image identifier; and storing the mirror image of the target container, and establishing an index relationship between the metadata and the storage address of the target container.
In one implementation, the client performs the pull operation of the target container image to the server in the following manner:
the client is connected with the server according to the server address and the login information contained in the configuration file;
and the server side performs identity authentication on the client side according to the login information and feeds back an identity authentication result.
The method comprises the steps that when a client receives an identity authentication success message, a target architecture of the client is obtained; initiating a pulling operation to a server, wherein the pulling operation carries metadata of a target container mirror image, and the metadata comprises a target architecture or a mirror image identifier; and receiving the target container mirror image fed back by the server side.
The server responds to a pulling operation sent by the client, wherein the pulling operation carries metadata, and the metadata comprises a target architecture or a mirror image identifier; determining a target container mirror image according to the metadata; and feeding back the target container mirror image to the client.
In one implementation, the user accesses the server through the client, and edits the target container image is performed through the following steps:
the client is connected with the server according to the server address and the login information contained in the configuration file;
and the server side performs identity authentication on the client side according to the login information and feeds back an identity authentication result.
When the client receives the successful authentication message, a visual interface provided by the server is displayed for the user;
the server side outputs options of container mirror image parameters in a visual interface, and receives first configuration information selected by a user according to the options, wherein the first configuration information comprises: a combination of one or more of a container-applicable target architecture, a dependent base container image, or a container image version; receiving second configuration information input by a user in the visual interface, wherein the second configuration information comprises: a combination of one or more of a container image description, a container image name, a software package on which the container image depends, a container run command, or a container execution script;
the server side generates a Dockerfile with an adaptive target architecture according to the first configuration information and the second configuration information; and calling a target virtual machine in the multiple virtual machines, and constructing a target container mirror image in the target virtual machine according to the Dockerfile file.
Furthermore, the logic of the server and the client provided in the embodiment of the present application may be deployed to different hardware devices in advance, so that the hardware devices have the functions of the server or the client to execute the method.
In one usage scenario, an Nginx application container image (i.e. a target container image) is constructed in a server side, and the constructed container image is pulled and an application is created in clients with different architectures:
1) two X86 architecture devices (or virtual machines) and one ARM architecture device (or virtual machine) in the same network environment are prepared. The two X86 architecture devices are referred to as "X86 device 1" and "X86 device 2", respectively. The ARM architecture device is called an "ARM rack device 1". The "X86 device 1" is taken as the server side of the present application, and the "X86 device 2" and the "ARM rack device 1" are taken as the two clients of the present application.
2) Respectively deploying operating systems with corresponding architectures and necessary Docker container environments in all the devices;
3) the scheme applied to the server side in the above embodiment is deployed in the "X86 device 1".
4) The scheme applied to the client in the above-described embodiment is deployed in "X86 device 2" and "ARM rack device 1".
5) The configuration files are edited in "X86 device 2" and "ARM rack device 1", respectively. The configuration file comprises information such as a server side connection address and a login information secret key, so that the client side can register information such as self architecture information, an IP address and a client side name with the server side.
6) And inputting the address of the server end through the browser, and inputting a user name and a password to log in the server end. In a visual container constructing interface provided by a server, selecting a container mirror image architecture, selecting a base container mirror image ubuntu with the latest version and other first configuration information; and inputting second configuration information such as a container image description nginx-test, a container image name nginx-test, a software package nginx on which the container image depends, a container running command, a container execution script and the like. And the server side respectively generates an X86 architecture-adapted Dockerfile file and an ARM architecture-adapted Dockerfile according to the selected or input container mirror image parameters.
7) The server side can provide a compiling interface for a user, and the user manually constructs the Nginx container mirror image of the corresponding architecture. And automatically generating the Nginx container mirror image of the corresponding architecture according to the acquired container mirror image parameters.
8) "X86 device 2" or "ARM shelf device 1" may pull the latest version of the constructed Nginx container image via the Docker command.
9) The "X86 device 2" or "ARM rack device 1" may create a Nginx container using a pulled-out Nginx container mirror. Good Nginx containers are created in a test heterogeneous environment.
EXAMPLE five
Fig. 5 is a schematic structural diagram of a container mirroring apparatus according to a fourth embodiment of the present application, where the apparatus is applied to a server side, and the apparatus includes: a container image parameter receiving module 410, a file generating module 420, a container image constructing module 430, and a container image transmitting module 440.
A container mirror image parameter receiving module 410, configured to receive a container mirror image parameter input by a user, where the container mirror image parameter includes a target architecture applicable to a container;
the file generation module 420 is configured to generate a Dockerfile adapted to the target architecture according to the container mirror image parameter;
the container mirror image constructing module 430 is configured to invoke a target virtual machine in the multiple virtual machines, construct a target container mirror image in the target virtual machine according to the Dockerfile file, run a compiling environment of the container mirror image of a target architecture in the target virtual machine, and include the multiple virtual machines at a server side;
and the container mirror image transmission module 440 is configured to determine a target container mirror image according to metadata carried in a container mirror image transmission operation triggered by the client, and perform transmission of the target container mirror image with the client.
Further, the container mirroring parameter receiving module 410 is configured to:
the method comprises the steps of outputting an option of container mirror image parameters in a visual interface, and receiving first configuration information selected by a user according to the option, wherein the first configuration information comprises: a combination of one or more of a container-applicable target architecture, a dependent base container image, or a container image version;
receiving second configuration information input by a user in the visual interface, wherein the second configuration information comprises: a combination of one or more of a container image description, a container image name, a software package on which the container image depends, a container run command, or a container execution script;
correspondingly, generating a Dockerfile adapted to the target architecture according to the container mirror image parameters includes:
and generating a Dockerfile with adaptive target architecture according to the first configuration information and the second configuration information.
Further, the container mirror transport module 440 is configured to:
responding to a pulling operation sent by a client, wherein the pulling operation carries metadata, and the metadata comprises a target architecture or a mirror image identifier;
determining a target container mirror image according to the metadata;
and feeding back the target container mirror image to the client.
Further, the container mirror transport module 440 is configured to:
receiving an uploading operation sent by a client, wherein the uploading operation carries metadata and a target container mirror image, and the metadata comprises a target architecture or a mirror image identifier;
and storing the mirror image of the target container, and establishing an index relationship between the metadata and the storage address of the target container.
Further, the container mirror transport module 440 is configured to: receiving login information sent by a client;
checking according to the login information;
and if the verification is successful, responding to the container mirror image transmission operation triggered by the client.
The container mirror image processing device provided by the embodiment of the application realizes management of container mirror images of a heterogeneous system by arranging a plurality of virtual machines. The container mirror image parameter receiving module 410 receives a container mirror image parameter under a target architecture input by a user, the file generating module 420 generates a Dockerfile file, and the container mirror image constructing module 430 constructs a target container mirror image according to the Dockerfile file in a virtual machine, so as to realize the editing function of the container mirror image through the compiling environment of the container mirror image provided by the virtual machine. Meanwhile, the container mirror image transmission module 440 can respond to the container mirror image transmission operation initiated by the client, so as to provide the client with a container mirror image function matched with the client architecture type, and improve the management efficiency of the container mirror image in the heterogeneous scene.
EXAMPLE six
Fig. 6 is a schematic structural diagram of a container mirroring apparatus according to a fourth embodiment of the present application, where the apparatus is applied to a client, and the apparatus includes: a connection module 510 and a target container mirror transport module 520.
A connection module 510, configured to connect to a server side, where container images of multiple architectures are stored;
and a target container mirror image transmission module 520, configured to initiate a transmission operation of a target container mirror image to the server, and perform target container mirror image transmission with the server, where the transmission operation includes metadata, and the target container mirror image is a container mirror image in a target architecture.
Further, the target container mirror transmission module 520 is configured to:
acquiring a target architecture of a client;
initiating a pulling operation to a server, wherein the pulling operation carries metadata of a target container mirror image, and the metadata comprises a target architecture or a mirror image identifier;
and receiving the target container mirror image fed back by the server side.
Further, the target container mirror transmission module 520 is configured to:
determining metadata from the local target container image, the metadata comprising: a target architecture or mirror identification;
and initiating an uploading operation to the server side, and sending the metadata and the local target container mirror image to the server side.
Further, the connection module 510 is configured to:
connecting the server side according to the server side address and the login information contained in the configuration file;
correspondingly, initiating a container mirror image transmission operation to the server, comprising:
and if the connection is successful, initiating a container mirror image transmission operation to the server side.
In the container mirror processing apparatus provided in the embodiment of the present application, after the client connects to the server through the connection module 510, the target container mirror transmission module 520 performs a transmission operation of a container mirror with the server. Because the server side stores container mirror images with different architectures, the client side can pull the target container mirror image in the target architecture from the server side according to the target architecture of the client side; meanwhile, the local target container mirror image and the metadata of the target container mirror image can be uploaded to the server, and the function of expanding the container mirror image for the server side by the client side is realized. In a heterogeneous scene, a plurality of clients can be respectively deployed with different architectures, when the server performs container mirror image transmission, the target container mirror image can be accurately determined in the server through identification information such as a target architecture, a version and the like contained in the metadata, and the clients can rapidly pull and upload the container mirror image in the heterogeneous scene.
It should be noted that, in the embodiment of the container mirror processing apparatus, the included units and modules are merely divided according to the functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
EXAMPLE seven
Fig. 7 is a schematic structural diagram of an electronic device according to a sixth embodiment of the present invention, as shown in fig. 7, the electronic device includes a processor 60 and a memory 61, and may further include an input device 62 and an output device 63; the number of the processors 60 in the electronic device may be one or more, and one processor 60 is taken as an example in fig. 7; the processor 60, the memory 61, the input device 62 and the output device 63 in the electronic apparatus may be connected by a bus or other means, and the connection by the bus is exemplified in fig. 7.
The memory 61, which is a computer-readable storage medium, may be used to store software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the container image processing method in the embodiment of the present invention (for example, the container image parameter receiving module 410, the file generating module 420, the container image constructing module 430, and the container image transmitting module 440). The processor 60 executes various functional applications and data processing of the electronic device by executing software programs, instructions and modules stored in the memory 61, that is, implements a container mirroring method applied to a server side, the method including:
receiving container mirror image parameters input by a user, wherein the container mirror image parameters comprise a target architecture applicable to a container;
generating a Dockerfile with adaptive target architecture according to the container mirror image parameters;
the server side comprises a plurality of virtual machines, a target virtual machine in the plurality of virtual machines is called, a target container mirror image is built in the target virtual machine according to the Dockerfile file, and a compiling environment of the container mirror image of a target architecture runs in the target virtual machine;
and responding to the container mirror image transmission operation triggered by the client, determining a target container mirror image according to metadata carried by the transmission operation, and transmitting the target container mirror image with the client.
Further, receiving user-input container mirroring parameters, comprising:
the method comprises the steps of outputting an option of container mirror image parameters in a visual interface, and receiving first configuration information selected by a user according to the option, wherein the first configuration information comprises: a combination of one or more of a container-applicable target architecture, a dependent base container image, or a container image version;
receiving second configuration information input by a user in the visual interface, wherein the second configuration information comprises: a combination of one or more of a container image description, a container image name, a software package on which the container image depends, a container run command, or a container execution script;
correspondingly, generating a Dockerfile adapted to the target architecture according to the container mirror image parameters includes:
and generating a Dockerfile with adaptive target architecture according to the first configuration information and the second configuration information.
Further, in response to a container mirror image transmission operation triggered by the client, determining a target container mirror image according to metadata carried in the transmission operation, and performing transmission of the target container mirror image with the client, including:
responding to a pulling operation sent by a client, wherein the pulling operation carries metadata, and the metadata comprises a target architecture or a mirror image identifier;
determining a target container mirror image according to the metadata;
and feeding back the target container mirror image to the client.
Further, in response to a container mirror image transmission operation triggered by the client, determining a target container mirror image according to metadata carried in the transmission operation, and performing transmission of the target container mirror image with the client, including:
receiving an uploading operation sent by a client, wherein the uploading operation carries metadata and a target container mirror image, and the metadata comprises a target architecture or a mirror image identifier;
and storing the mirror image of the target container, and establishing an index relationship between the metadata and the storage address of the target container.
Further, in response to a client-triggered container mirror transfer operation, the method includes:
receiving login information sent by a client;
checking according to the login information;
and if the verification is successful, responding to the container mirror image transmission operation triggered by the client.
The memory 61, which is a computer-readable storage medium, may be used to store software programs, computer-executable programs, and modules, such as program instructions/modules (e.g., the connection module 510 and the target container image transmission module 520) corresponding to the container image processing method in the embodiment of the present invention. The processor 60 executes various functional applications and data processing of the electronic device by executing software programs, instructions and modules stored in the memory 61, that is, implements a container mirroring processing method applied to a client, the method including:
connecting a server side, wherein container images of various architectures are stored in the server side;
and initiating a transmission operation of the target container mirror image to the server side, and performing target container mirror image transmission with the server side, wherein the transmission operation comprises metadata, and the target container mirror image is a container mirror image under a target architecture.
Further, initiating a transmission operation of the target container mirror image to the server side, and performing target container mirror image transmission with the server side, including:
acquiring a target architecture of a client;
initiating a pulling operation to a server, wherein the pulling operation carries metadata of a target container mirror image, and the metadata comprises a target architecture or a mirror image identifier;
and receiving the target container mirror image fed back by the server side.
Further, initiating a transmission operation of the target container mirror image to the server side, and performing target container mirror image transmission with the server side, including:
determining metadata from the local target container image, the metadata comprising: a target architecture or mirror identification;
and initiating an uploading operation to the server side, and sending the metadata and the local target container mirror image to the server side.
Further, connect the server side, including:
connecting the server side according to the server side address and the login information contained in the configuration file;
correspondingly, initiating a container mirror image transmission operation to the server, comprising:
and if the connection is successful, initiating a container mirror image transmission operation to the server side.
The memory 61 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 61 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 61 may further include memory located remotely from the processor 60, which may be connected to the electronic device through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 62 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function controls of the electronic apparatus. The output device 63 may include a display device such as a display screen.
EXAMPLE seven
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, where the computer-executable instructions are executed by a computer processor to perform a container mirroring method, where the method includes:
receiving container mirror image parameters input by a user, wherein the container mirror image parameters comprise a target architecture applicable to a container;
generating a Dockerfile with adaptive target architecture according to the container mirror image parameters;
the server side comprises a plurality of virtual machines, a target virtual machine in the plurality of virtual machines is called, a target container mirror image is built in the target virtual machine according to the Dockerfile file, and a compiling environment of the container mirror image of a target architecture runs in the target virtual machine;
and responding to the container mirror image transmission operation triggered by the client, determining a target container mirror image according to metadata carried by the transmission operation, and transmitting the target container mirror image with the client.
Further, receiving user-input container mirroring parameters, comprising:
the method comprises the steps of outputting an option of container mirror image parameters in a visual interface, and receiving first configuration information selected by a user according to the option, wherein the first configuration information comprises: a combination of one or more of a container-applicable target architecture, a dependent base container image, or a container image version;
receiving second configuration information input by a user in the visual interface, wherein the second configuration information comprises: a combination of one or more of a container image description, a container image name, a software package on which the container image depends, a container run command, or a container execution script;
correspondingly, generating a Dockerfile adapted to the target architecture according to the container mirror image parameters includes:
and generating a Dockerfile with adaptive target architecture according to the first configuration information and the second configuration information.
Further, in response to a container mirror image transmission operation triggered by the client, determining a target container mirror image according to metadata carried in the transmission operation, and performing transmission of the target container mirror image with the client, including:
responding to a pulling operation sent by a client, wherein the pulling operation carries metadata, and the metadata comprises a target architecture or a mirror image identifier;
determining a target container mirror image according to the metadata;
and feeding back the target container mirror image to the client.
Further, in response to a container mirror image transmission operation triggered by the client, determining a target container mirror image according to metadata carried in the transmission operation, and performing transmission of the target container mirror image with the client, including:
receiving an uploading operation sent by a client, wherein the uploading operation carries metadata and a target container mirror image, and the metadata comprises a target architecture or a mirror image identifier;
and storing the mirror image of the target container, and establishing an index relationship between the metadata and the storage address of the target container.
Further, before responding to the client-triggered container mirror transmission operation, the method further comprises:
receiving login information sent by a client;
checking according to the login information;
correspondingly, the container image transmission operation triggered by the response client comprises the following steps:
and if the verification is successful, responding to the container mirror image transmission operation triggered by the client.
When applied to a client, the method comprises:
connecting a server side, wherein container images of various architectures are stored in the server side;
and initiating a transmission operation of the target container mirror image to the server side, and performing target container mirror image transmission with the server side, wherein the transmission operation comprises metadata, and the target container mirror image is a container mirror image under a target architecture.
Further, initiating a transmission operation of the target container mirror image to the server side, and performing target container mirror image transmission with the server side, including:
acquiring a target architecture of a client;
initiating a pulling operation to a server, wherein the pulling operation carries metadata of a target container mirror image, and the metadata comprises a target architecture or a mirror image identifier;
and receiving the target container mirror image fed back by the server side.
Further, initiating a transmission operation of the target container mirror image to the server side, and performing target container mirror image transmission with the server side, including:
determining metadata from the local target container image, the metadata comprising: a target architecture or mirror identification;
and initiating an uploading operation to the server side, and sending the metadata and the local target container mirror image to the server side.
Further, connect the server side, including:
connecting the server side according to the server side address and the login information contained in the configuration file;
correspondingly, initiating a container mirror image transmission operation to the server, comprising:
and if the connection is successful, initiating a container mirror image transmission operation to the server side.
Of course, the storage medium provided by the embodiment of the present invention contains computer-executable instructions, and the computer-executable instructions are not limited to the above method operations, and may also perform related operations in the container mirroring processing method provided by any embodiment of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods of the embodiments of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (12)

1. A container mirror image processing method is applied to a server side and comprises the following steps:
receiving container mirror image parameters input by a user, wherein the container mirror image parameters comprise a target architecture applicable to a container and configuration information for constructing a container mirror image;
generating a Dockerfile adapted to the target architecture according to the container mirror image parameters;
the server side comprises a plurality of virtual machines, a target virtual machine in the plurality of virtual machines is called, a target container mirror image is constructed in the target virtual machine according to the Dockerfile file, and a compiling environment of the container mirror image of the target architecture runs in the target virtual machine;
responding to container mirror image transmission operation triggered by a client, determining the target container mirror image according to metadata carried by the transmission operation, and transmitting the target container mirror image with the client, wherein the metadata comprises a target architecture applicable to the client and a mirror image identifier of a requested target container mirror image;
the generating the Dockerfile adapted to the target architecture according to the container mirror image parameters includes: determining a Dockerfile file format adaptive to the target architecture according to the target architecture, and generating the Dockerfile file adaptive to the target architecture according to the configuration information.
2. The method of claim 1, wherein receiving user-entered container mirroring parameters comprises:
outputting an option of container mirror image parameters in a visual interface, and receiving a target architecture selected by a user according to the option and first configuration information, wherein the first configuration information comprises: a combination of one or more of a container-applicable target architecture, a dependent base container image, or a container image version;
receiving second configuration information input by the user in the visual interface, wherein the second configuration information comprises: a combination of one or more of a container image description, a container image name, a software package on which the container image depends, a container run command, or a container execution script;
correspondingly, the generating the target architecture adapted Dockerfile according to the container mirror image parameters includes:
and generating a Dockerfile adapted to the target architecture according to the target architecture, the first configuration information and the second configuration information.
3. The method according to claim 1, wherein the determining the target container image according to the metadata carried in the transfer operation in response to the client-triggered container image transfer operation, and the transferring the target container image with the client comprises:
responding to a pulling operation sent by the client, wherein the pulling operation carries metadata;
determining a target container mirror image according to the metadata;
and feeding back the target container mirror image to the client.
4. The method according to claim 1, wherein the determining the target container image according to the metadata carried in the transfer operation in response to the client-triggered container image transfer operation, and the transferring the target container image with the client comprises:
receiving an uploading operation sent by the client, wherein the uploading operation carries metadata and a target container mirror image;
and storing the target container mirror image, and establishing an index relationship between the metadata and the storage address of the target container.
5. The method of claim 1, further comprising, prior to the container mirror transfer operation being triggered in response to a client:
receiving login information sent by a client;
checking according to the login information;
correspondingly, the container image transmission operation triggered by the response client comprises the following steps:
and if the verification is successful, responding to the container mirror image transmission operation triggered by the client.
6. A container mirror image processing method is applied to a client and comprises the following steps:
connecting a server side, wherein container images of various architectures are stored in the server side;
initiating a transmission operation of a target container mirror image to the server, and performing the target container mirror image transmission with the server, wherein the transmission operation comprises metadata, the target container mirror image is a container mirror image under a target architecture, and the metadata comprises the target architecture applicable to the client and a mirror image identifier of the requested target container mirror image;
the server side generates a Dockerfile file adaptive to the target architecture according to the container mirror image parameters;
the server side comprises a plurality of virtual machines, a target virtual machine in the plurality of virtual machines is called, a target container mirror image is constructed in the target virtual machine according to the Dockerfile file, and a compiling environment of the container mirror image of the target architecture runs in the target virtual machine;
the step of generating the Dockerfile adapted to the target architecture by the server according to the container mirror image parameters comprises the following steps: determining a Dockerfile file format adaptive to the target architecture according to the target architecture, and generating the Dockerfile file adaptive to the target architecture according to configuration information.
7. The method according to claim 6, wherein the initiating the transmission operation of the target container image to the server side and performing the target container image transmission with the server side includes:
acquiring a target architecture of the client;
initiating a pulling operation to the server, wherein the pulling operation carries metadata of a target container mirror image;
and receiving the target container mirror image fed back by the server side.
8. The method according to claim 6, wherein the initiating the transmission operation of the target container image to the server side and performing the target container image transmission with the server side includes:
determining metadata according to a local target container mirror image;
and initiating an uploading operation to the server side, and sending the metadata and the local target container mirror image to the server side.
9. The method according to claim 6, wherein the connecting to the server side comprises:
connecting the server side according to the server side address and the login information contained in the configuration file;
correspondingly, the initiating the container mirror image transmission operation to the server side includes:
and if the connection is successful, initiating a container mirror image transmission operation to the server side.
10. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the container mirroring method of any of claims 1-9.
11. A storage medium containing computer-executable instructions for performing the container mirroring method of any one of claims 1 to 9 when executed by a computer processor.
12. A container mirroring system, comprising: a server side and a client side;
the server receives container mirror image parameters input by a user, wherein the container mirror image parameters comprise a target architecture applicable to a container; generating a Dockerfile adapted to the target architecture according to the container mirror image parameters; the server side comprises a plurality of virtual machines, a target virtual machine in the plurality of virtual machines is called, a target container mirror image is constructed in the target virtual machine according to the Dockerfile file, and a compiling environment of the container mirror image of the target architecture runs in the target virtual machine;
the client is connected with a server, and container images with various architectures are stored in the server; initiating a container mirror image transmission operation to the server side, wherein the transmission operation comprises metadata;
the server side responds to container mirror image transmission operation triggered by a client side, determines a target container mirror image according to metadata carried by the transmission operation, and transmits the target container mirror image with the client side, wherein the target container mirror image is the container mirror image under a target architecture, and the metadata comprises a target architecture applicable to the client side and mirror image identification of the requested target container mirror image;
the generating the Dockerfile adapted to the target architecture according to the container mirror image parameters includes: determining a Dockerfile file format adaptive to the target architecture according to the target architecture, and generating the Dockerfile file adaptive to the target architecture according to configuration information.
CN202010495694.6A 2020-06-03 2020-06-03 Container mirror image processing method, electronic device, storage medium and system Active CN111666129B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010495694.6A CN111666129B (en) 2020-06-03 2020-06-03 Container mirror image processing method, electronic device, storage medium and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010495694.6A CN111666129B (en) 2020-06-03 2020-06-03 Container mirror image processing method, electronic device, storage medium and system

Publications (2)

Publication Number Publication Date
CN111666129A CN111666129A (en) 2020-09-15
CN111666129B true CN111666129B (en) 2022-03-22

Family

ID=72385883

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010495694.6A Active CN111666129B (en) 2020-06-03 2020-06-03 Container mirror image processing method, electronic device, storage medium and system

Country Status (1)

Country Link
CN (1) CN111666129B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527456A (en) * 2020-12-10 2021-03-19 国网四川省电力公司信息通信公司 Method for business application containerization transformation and mirror image manufacturing
CN114765606B (en) * 2020-12-30 2023-07-25 中国联合网络通信集团有限公司 Container mirror image transmission method, device, equipment and storage medium
CN112631737B (en) * 2021-01-08 2023-11-17 重庆紫光华山智安科技有限公司 Container mirror image construction method, device, electronic equipment and storage medium
CN112799688A (en) * 2021-01-18 2021-05-14 中国银联股份有限公司 Method and device for installing software package in container application, computer equipment and medium
CN113032095A (en) * 2021-03-15 2021-06-25 深圳市瑞驰信息技术有限公司 System and method for realizing android container operation on ARM architecture
CN117389690B (en) * 2023-12-08 2024-03-15 中电云计算技术有限公司 Mirror image package construction method, device, equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201648A (en) * 2016-06-27 2016-12-07 浪潮电子信息产业股份有限公司 A kind of virtual machine creation method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105630488A (en) * 2015-12-18 2016-06-01 上海爱数信息技术股份有限公司 Docker container technology-based continuous integration realizing method
CN113900778A (en) * 2018-03-16 2022-01-07 华为技术有限公司 Scheduling method and device and main node
CN110263546B (en) * 2019-05-24 2023-05-05 创新先进技术有限公司 Method, device and equipment for carrying out security check on container mirror image
CN111061487A (en) * 2019-12-16 2020-04-24 厦门市美亚柏科信息股份有限公司 Container-based load balancing distributed compiling system and method

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201648A (en) * 2016-06-27 2016-12-07 浪潮电子信息产业股份有限公司 A kind of virtual machine creation method and device

Also Published As

Publication number Publication date
CN111666129A (en) 2020-09-15

Similar Documents

Publication Publication Date Title
CN111666129B (en) Container mirror image processing method, electronic device, storage medium and system
JP6621543B2 (en) Automatic update of hybrid applications
CN112165532B (en) Node access method, device, equipment and computer readable storage medium
CN108664331B (en) Distributed data processing method and device, electronic equipment and storage medium
CN108804618B (en) Database configuration method, device, computer equipment and storage medium
CN111683066B (en) Heterogeneous system integration method, heterogeneous system integration device, computer equipment and storage medium
CN108287894B (en) Data processing method, device, computing equipment and storage medium
TW201444320A (en) Setup method and system for client and server environment
CN112860479A (en) Data storage method and cloud data center
CN112732572A (en) Service testing method, device and system, storage medium and electronic device
WO2023040143A1 (en) Cloud service resource orchestration method and apparatus, and device and storage medium
CN116644250B (en) Page detection method, page detection device, computer equipment and storage medium
CN112543109A (en) Cloud host creation method, system, server and storage medium
CN111107120B (en) Redis cluster construction method and system
CN105144073A (en) Removable storage device identity and configuration information
CN104570967A (en) Android system based remote control method and system
CN113590564B (en) Data storage method, device, electronic equipment and storage medium
CN115878128A (en) Deployment method and device of application program
CN115904407A (en) Mirror image construction method, system and computer readable storage medium
CN114579123A (en) Display frame, page display method, electronic device and storage medium
CN109302446B (en) Cross-platform access method and device, electronic equipment and storage medium
CN115129779A (en) Database synchronization method, device and readable medium
CN113760688A (en) Remote debugging method, system, webpage server, equipment and storage medium
CN104750794B (en) A kind of data search method, device and system
CN108255883B (en) Data acquisition method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant