CN110308972A - Method and apparatus for managing container mirror image - Google Patents

Method and apparatus for managing container mirror image Download PDF

Info

Publication number
CN110308972A
CN110308972A CN201910602797.5A CN201910602797A CN110308972A CN 110308972 A CN110308972 A CN 110308972A CN 201910602797 A CN201910602797 A CN 201910602797A CN 110308972 A CN110308972 A CN 110308972A
Authority
CN
China
Prior art keywords
virtual machine
qcow2
mirror image
file
lightweight
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.)
Pending
Application number
CN201910602797.5A
Other languages
Chinese (zh)
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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201910602797.5A priority Critical patent/CN110308972A/en
Publication of CN110308972A publication Critical patent/CN110308972A/en
Pending legal-status Critical Current

Links

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
    • 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)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Embodiment of the disclosure discloses the method and apparatus for managing container mirror image.One specific embodiment of this method includes: creation qcow2 file, and starts the mirroring agent virtual machine of the virtual disk with qcow2 file;The virtual disk of qcow2 file is mounted to the first mirror image catalogue specified in mirroring agent virtual machine;The the first mirror image catalogue for being mirrored to and specifying in mirroring agent virtual machine is pulled from container image source;Snapshot is done to qcow2 file and generates qcow2 snapshot document;Start lightweight virtual machine, and disk and carry that qcow2 snapshot document is invented lightweight virtual machine are to lightweight virtual machine;The virtual disk of qcow2 snapshot document is mounted to the second mirror image catalogue specified in lightweight virtual machine.The embodiment effectively combines the qcow2 technology of conventional virtual machine mirror image management, realize it is a set of can agree with the mirror image management method based on lightweight virtual machine container engine completely, compensate for insufficient in cloud computing application of this kind of container scheme and support.

Description

Method and apparatus for managing container mirror image
Technical field
Embodiment of the disclosure is related to field of computer technology, and in particular to for managing the method and dress of container mirror image It sets.
Background technique
With docker, the rise of the technologies such as kubernetes, container on cloud environment using increasingly extensive.And industry Also the isolation of container is put forward new requirements, it is desirable to be able to the isolation that container matches in excellence or beauty conventional virtual machine is assigned, to fit Cloud environment for this multi-tenant of public cloud.Kata Containers is then a kind of new container engine for meeting this class standard, It is substantially a kind of virtual machine of lightweight, and multi-tenant is isolated using hardware virtualization technology, while supporting existing Container standard (OCI), compatible docker, kubernetes.
But this kind of container engine based on lightweight virtual machine of Kata Containers is in the existing container mirror image of compatibility When standard, there are certain deficiencies.Because container mirrored storage is normally based on hierarchical file system to realize, i.e. container mirror image It is the presentation in the form of catalogue on host, and when virtual machine will use them, it needs saturating by way of share directory It is transmitted to empty machine, but share directory technology (9pfs, virtiofs) at this stage is not also very perfect, many key properties, Such as: quota (Disk Quota Technique), speed limit, snapshot, on-line rapid estimation etc. are all lacked.Therefore, a set of new container mirror image is realized Management method, can agree with this kind of container engine based on lightweight virtual machine of Kata Containers completely is to have very much It is necessary.
Summary of the invention
Embodiment of the disclosure proposes the method and apparatus for managing container mirror image.
In a first aspect, embodiment of the disclosure provides a kind of method for managing container mirror image, comprising: creation Qcow2 file, and start the mirroring agent virtual machine of the virtual disk with qcow2 file;By the virtual disk of qcow2 file It is mounted to the first mirror image catalogue specified in mirroring agent virtual machine;It is pulled from container image source and is mirrored to mirroring agent virtual machine In specify the first mirror image catalogue;Snapshot is done to qcow2 file and generates qcow2 snapshot document;Start lightweight virtual machine, and will Qcow2 snapshot document invents the disk of lightweight virtual machine and carry to lightweight virtual machine;Qcow2 snapshot document is virtual Disk be mounted in lightweight virtual machine specify the second mirror image catalogue.
In some embodiments, this method further include: it is virtual that the mirror image for using lightweight virtual machine is pushed to lightweight The the second mirror image catalogue specified in machine;Snapshot is done to the qcow2 file in the second mirror image catalogue and generates target qcow2 file;It will Target qcow2 file invents the disk of mirroring agent virtual machine and carry gives mirroring agent virtual machine;By target qcow2 file Virtual disk is mounted to the first mirror image catalogue specified in mirroring agent virtual machine.
In some embodiments, qcow2 file is created, comprising: create the qcow2 file of specified size, and qcow2 is literary Part is formatted into specified file system.
In some embodiments, this method further include: the size of adjustment qcow2 file.
In some embodiments, this method further include: qcow2 file is encrypted.
In some embodiments, this method further include: qcow2 file is compressed.
Second aspect, embodiment of the disclosure provide a kind of for managing the device of container mirror image, comprising: creation is single Member is configured to create qcow2 file, and starts the mirroring agent virtual machine of the virtual disk with qcow2 file;First hangs Carrier unit is configured to for the virtual disk of qcow2 file being mounted to the first mirror image catalogue specified in mirroring agent virtual machine; Unit is pulled, is configured to pull the first mirror image catalogue for being mirrored to and specifying in mirroring agent virtual machine from container image source;The One snapshot unit is configured to make qcow2 file snapshot and generates qcow2 snapshot document;First dummy unit is configured to open Dynamic lightweight virtual machine, and disk and carry that qcow2 snapshot document is invented lightweight virtual machine are to lightweight virtual machine; Second carry unit is configured to for the virtual disk of qcow2 snapshot document being mounted to second specified in lightweight virtual machine Mirror image catalogue.
In some embodiments, device further include: push unit is configured to the mirror image for using lightweight virtual machine It is pushed to the second mirror image catalogue specified in lightweight virtual machine;Second snapshot unit is configured to in the second mirror image catalogue Qcow2 file do snapshot generate target qcow2 file;Second dummy unit is configured to invent target qcow2 file The disk and carry of mirroring agent virtual machine give mirroring agent virtual machine;First carry unit is further configured to target The virtual disk of qcow2 file is mounted to the first mirror image catalogue specified in mirroring agent virtual machine.
In some embodiments, creating unit is further configured to: creating the qcow2 file of specified size, and will Qcow2 file format is melted into specified file system.
In some embodiments, which further includes adjustment unit, is configured to: the size of adjustment qcow2 file.
In some embodiments, which further includes that encryption unit is configured to: being encrypted to qcow2 file.
In some embodiments, which further includes compression unit, is configured to: being compressed to qcow2 file.
The third aspect, embodiment of the disclosure provide a kind of electronic equipment, comprising: one or more processors;Storage Device is stored thereon with one or more programs, when one or more programs are executed by one or more processors, so that one Or multiple processors are realized such as method any in first aspect.
Fourth aspect, embodiment of the disclosure provide a kind of computer-readable medium, are stored thereon with computer program, Wherein, it realizes when program is executed by processor such as method any in first aspect.
The method and apparatus for managing container mirror image that embodiment of the disclosure provides, by conventional virtual machine mirror image It manages this block to be used using extensive qcow2 technology, combines it with existing container mirror method, realize a set of This kind of mirror image management method based on lightweight virtual machine container engine of Kata Containers can be agreed with completely.Can have Effect utilizes all characteristics of conventional virtual machine, this is also the east being short of when current container scheme is applied under publicly-owned cloud environment West, such as: speed limit, quota are encrypted, compression, thermophoresis, on-line rapid estimation etc..
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the disclosure is other Feature, objects and advantages will become more apparent upon:
Fig. 1 is that one embodiment of the disclosure can be applied to exemplary system architecture figure therein;
Fig. 2 is the flow chart according to one embodiment of the method for managing container mirror image of the disclosure;
Fig. 3 is the schematic diagram according to an application scenarios of the method for managing container mirror image of the disclosure;
Fig. 4 is the flow chart according to another embodiment of the method for managing container mirror image of the disclosure;
Fig. 5 is the structural schematic diagram according to one embodiment of the device for managing container mirror image of the disclosure;
Fig. 6 is adapted for the structural schematic diagram for the computer system for realizing the electronic equipment of embodiment of the disclosure.
Specific embodiment
The disclosure is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to Convenient for description, part relevant to related invention is illustrated only in attached drawing.
It should be noted that in the absence of conflict, the feature in embodiment and embodiment in the disclosure can phase Mutually combination.The disclosure is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 is shown can the method for managing container mirror image using the disclosure or the dress for managing container mirror image The exemplary system architecture 100 for the embodiment set.
As shown in Figure 1, system architecture 100 may include container image source 101,102,103, network 104 and host 105.Network 104 between container image source 101,102,103 and host 105 to provide the medium of communication link.Network 104 may include various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used container image source 101,102,103 and be interacted with host 105 by network 104, with reception or Send message etc..Container image source 101,102,103 can come from different container providers.
Host 105 can be to provide the server of various container services.Server can pull appearance from container image source Device mirror image simultaneously runs container.
It should be noted that for managing the method for container mirror image generally by host provided by embodiment of the disclosure 105 execute, and correspondingly, the device for managing container mirror image is generally positioned in host 105.
It should be understood that the number of terminal device, network and server in Fig. 1 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
With continued reference to Fig. 2, the stream of one embodiment of the method for managing container mirror image according to the disclosure is shown Journey 200.The method for being used to manage container mirror image, comprising the following steps:
Step 201, qcow2 file is created, and starts the mirroring agent virtual machine of the virtual disk with qcow2 file.
In the present embodiment, exist for managing the executing subject (such as host shown in FIG. 1) of the method for container mirror image Host creates qcow2 file.The size of the qcow2 file can be identical as system disk size.And by the qcow2 document formatting At specified file system (e.g., ext4).Qcow2 is the super mirror-image format for integrating various technologies, supports internal snapshot, adds Close, a series of functions, the access performance such as compression are also being continuously improved.Optionally, the qcow2 file that specified size can be created, from And to Disk Quota Technique.The disclosure introduces a mirroring agent virtual machine, and the disk of the mirroring agent void machine is by host Qcow2 file fictionalize come.The virtual technologies disk such as virtio-blk/virtio-scsi can be passed through.
Step 202, the virtual disk of qcow2 file is mounted to the first mirror image mesh specified in mirroring agent virtual machine Record.
In the present embodiment, it can refer to the method that hard disk is mounted to catalogue in the prior art, details are not described herein.
Step 203, the first mirror image catalogue for being mirrored to and specifying in mirroring agent virtual machine is pulled from container image source.
In the present embodiment, mirror image generation can be notified by RPC (Remote Procedure Call, remote procedure call) It manages the agency service in empty machine and pulls mirror image from container image source, and the mirror image pulled is stored in mirroring agent virtual machine middle finger The first fixed mirror image catalogue, that is, pull in the catalogue that qcow2 file corresponds to disk.
Step 204, snapshot is done to qcow2 file and generates qcow2 snapshot document.
In the present embodiment, snapshot (snapshot) can be memory, the disk file at some time point of virtual machine etc. State saves as an image file.By this image file, can work as to restore virtual machine any time afterwards When create snapshot state, this is very useful when using virtual machine to test.That is, qcow2 snapshot document is The image file of qcow2 file.Here the method that snapshot uses copy on write, when snapshot, by current mirror image File no longer changes, and creates a new image file, and using original image file as backup file, then virtual machine is used New image file.
Step 205, start lightweight virtual machine, and qcow2 snapshot document is invented into the disk of lightweight virtual machine simultaneously Carry is to lightweight virtual machine.
In the present embodiment, by qcow2 snapshot document by this kind of virtual technology of virtio-blk/virtio-scsi at The disk and carry of lightweight virtual machine are to lightweight virtual machine.Lightweight virtual machine refers to the energy such as Kata Containers The isolation that container matches in excellence or beauty conventional virtual machine is assigned, is drawn to be suitable for the new container of cloud environment of this multi-tenant of public cloud It holds up, multi-tenant is isolated using hardware virtualization technology, while supporting existing container standard (OCI), compatible docker, kubernetes.But this kind of container engine based on lightweight virtual machine of Kata Containers is in the existing container of compatibility When mirror image standard, there are certain deficiencies.Because container mirrored storage is normally based on hierarchical file system to realize, i.e. container Mirror image is the presentation in the form of catalogue on host, and when virtual machine will use them, need the side by share directory Formula passes through empty machine, but share directory technology (9pfs, virtiofs) at this stage is not also very perfect, many important spies Property, such as: quota, speed limit, snapshot, on-line rapid estimation etc. are all lacked.
Step 206, the virtual disk of qcow2 snapshot document is mounted to the second mirror image mesh specified in lightweight virtual machine Record.
In the present embodiment, it can refer to the method that hard disk is mounted to catalogue in the prior art, details are not described herein.
It is one of the application scenarios of the method according to the present embodiment for managing container mirror image with continued reference to Fig. 3, Fig. 3 Schematic diagram.In the application scenarios of Fig. 3, by introducing a mirroring agent virtual machine, the disk of the mirroring agent void machine is logical The qcow2 file crossed on host fictionalizes next.When needing to pull mirror image from container image source, this pulls operation can be by mirror It is executed as acting on behalf of the agency service in empty machine, container mirror image can be stored in some catalogue of empty machine disk after the completion of pulling In.At this point, we produce the qcow2 snapshot comprising container mirror image catalogue again by carrying out snapshot to qcow2 file File.When this kind of container engine based on lightweight virtual machine of Kata Containers is needed using the mirror image, we are only needed By the snapshot document by this kind of virtual technology of virtio-blk/virtio-scsi at the disk of lightweight virtual machine. Certainly, we can also be pushed in image source by reverse operating, the mirror image that lightweight virtual machine is used.
In this way, the container mirror image of catalogue form has finally been copied in qcow2 file by us, qcow2 file is virtual It is used at the disk of lightweight virtual machine.This have the advantage that the mirror image of lightweight virtual machine is finally united with conventional virtual machine One, all characteristics of conventional virtual machine can be efficiently used, this is also that current container scheme applies when institute under publicly-owned cloud environment The thing of shortcoming, such as: speed limit, quota are encrypted, compression, thermophoresis, on-line rapid estimation etc..
With further reference to Fig. 4, it illustrates the processes 400 of another embodiment of the method for managing container mirror image. This is used to manage the process 400 of the method for container mirror image, comprising the following steps:
Step 401, mirror image lightweight virtual machine used is pushed to the second mirror image mesh specified in lightweight virtual machine Record.
It in the present embodiment, will for managing the executing subject (such as host shown in FIG. 1) of the method for container mirror image The mirror image that host lightweight virtual machine uses is pushed in the second mirror image catalogue specified in lightweight virtual machine.Second mirror image Qcow2 file created is had existed in catalogue, such as the qcow2 snapshot document of step 204, usable lightweight virtual machine makes Mirror image covers original qcow2 file.
Step 402, snapshot is done to the qcow2 file in the second mirror image catalogue and generates target qcow2 file.
In the present embodiment, essentially identical with step 204, according to the qcow2 file generated mirror image in the second mirror image catalogue File.
Step 403, by target qcow2 file invent mirroring agent virtual machine disk and carry it is virtual to mirroring agent Machine.
In the present embodiment, snapshot document step 402 generated invents the disk and carry of mirroring agent virtual machine Give mirroring agent virtual machine.
Step 404, the virtual disk of target qcow2 file is mounted to the first mirror image specified in mirroring agent virtual machine Catalogue.
In the present embodiment, such container image source may have access to snapshot document by the first mirror image catalogue, that is, container mirror Image source has obtained the mirror image that lightweight virtual machine uses.
Figure 4, it is seen that being used to manage container mirror image in the present embodiment compared with the corresponding embodiment of Fig. 2 The process 400 of method embodies the step of mirror image for using virtual machine is pushed to container image source.The present embodiment describes as a result, Scheme can modify the mirror image in container image source.
With further reference to Fig. 5, as the realization to method shown in above-mentioned each figure, present disclose provides one kind to hold for managing One embodiment of the device of device mirror image, the Installation practice is corresponding with embodiment of the method shown in Fig. 2, which specifically may be used To be applied in various electronic equipments.
As shown in figure 5, the device 500 for managing container mirror image of the present embodiment includes: that creating unit 501, first is hung Carrier unit 502 pulls unit 503, the first snapshot unit 504, the first dummy unit 505 and the second carry unit 506.Wherein, Creating unit 501 is configured to create qcow2 file, and the mirroring agent for starting the virtual disk with qcow2 file is virtual Machine;First carry unit 502, be configured to for the virtual disk of qcow2 file being mounted in mirroring agent virtual machine specify First mirror image catalogue;Pull unit 503, be configured to pull from container image source be mirrored in mirroring agent virtual machine specify First mirror image catalogue;First snapshot unit 504 is configured to make qcow2 file snapshot and generates qcow2 snapshot document;First Dummy unit 505 is configured to start lightweight virtual machine, and qcow2 snapshot document is invented to the magnetic of lightweight virtual machine Disk and carry are to lightweight virtual machine;Second carry unit 506 is configured to the disk carry that qcow2 snapshot document is virtual The the second mirror image catalogue specified into lightweight virtual machine.
In the present embodiment, for manage the creating unit 501 of the device 500 of container mirror image, the first carry unit 502, The specific processing for pulling unit 503, the first snapshot unit 504, the first dummy unit 505 and the second carry unit 506 can be joined Examine the step 201-206 in Fig. 2 corresponding embodiment.
In some optional implementations of the present embodiment, device 500 further include: push unit (does not show in attached drawing Out), the mirror image for being configured to use lightweight virtual machine is pushed to the second mirror image catalogue specified in lightweight virtual machine;The Two snapshot units (attached to be not shown in the figure) are configured to make the qcow2 file in the second mirror image catalogue snapshot and generate target Qcow2 file;Second dummy unit (attached to be not shown in the figure) is configured to invent target qcow2 file mirroring agent void The disk and carry of quasi- machine give mirroring agent virtual machine;First carry unit is further configured to target qcow2 file is empty Quasi- disk is mounted to the first mirror image catalogue specified in mirroring agent virtual machine.
In some optional implementations of the present embodiment, creating unit 501 is further configured to: creation is specified big Small qcow2 file, and qcow2 file format is melted into specified file system.
In some optional implementations of the present embodiment, device 500 further includes adjustment unit (attached to be not shown in the figure), It is configured to: the size of adjustment qcow2 file.
In some optional implementations of the present embodiment, device 500 further includes encryption unit (attached to be not shown in the figure), It is configured to: qcow2 file is encrypted.
In some optional implementations of the present embodiment, device 500 further includes compression unit (attached to be not shown in the figure), It is configured to: qcow2 file is compressed.
Below with reference to Fig. 6, it illustrates the electronic equipment that is suitable for being used to realize embodiment of the disclosure, (example is as shown in figure 1 Host) 600 structural schematic diagram.Host shown in Fig. 6 is only an example, should not be to the function of embodiment of the disclosure Any restrictions can be brought with use scope.
As shown in fig. 6, electronic equipment 600 may include processing unit (such as central processing unit, graphics processor etc.) 601, random access can be loaded into according to the program being stored in read-only memory (ROM) 602 or from storage device 608 Program in memory (RAM) 603 and execute various movements appropriate and processing.In RAM 603, it is also stored with electronic equipment Various programs and data needed for 600 operations.Processing unit 601, ROM 602 and RAM 603 pass through the phase each other of bus 604 Even.Input/output (I/O) interface 605 is also connected to bus 604.
In general, following device can connect to I/O interface 605: including such as touch screen, touch tablet, keyboard, mouse, taking the photograph As the input unit 606 of head, microphone, accelerometer, gyroscope etc.;Including such as liquid crystal display (LCD), loudspeaker, vibration The output device 607 of dynamic device etc.;Storage device 608 including such as tape, hard disk etc.;And communication device 609.Communication device 609, which can permit electronic equipment 600, is wirelessly or non-wirelessly communicated with other equipment to exchange data.Although Fig. 6 shows tool There is the electronic equipment 600 of various devices, it should be understood that being not required for implementing or having all devices shown.It can be with Alternatively implement or have more or fewer devices.Each box shown in Fig. 6 can represent a device, can also root According to needing to represent multiple devices.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium On computer program, which includes the program code for method shown in execution flow chart.In such reality It applies in example, which can be downloaded and installed from network by communication device 609, or from storage device 608 It is mounted, or is mounted from ROM 602.When the computer program is executed by processing unit 601, the implementation of the disclosure is executed The above-mentioned function of being limited in the method for example.It should be noted that computer-readable medium described in embodiment of the disclosure can be with It is computer-readable signal media or computer readable storage medium either the two any combination.It is computer-readable Storage medium for example may be-but not limited to-the system of electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor, device or Device, or any above combination.The more specific example of computer readable storage medium can include but is not limited to: have The electrical connection of one or more conducting wires, portable computer diskette, hard disk, random access storage device (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD- ROM), light storage device, magnetic memory device or above-mentioned any appropriate combination.In embodiment of the disclosure, computer Readable storage medium storing program for executing can be any tangible medium for including or store program, which can be commanded execution system, device Either device use or in connection.And in embodiment of the disclosure, computer-readable signal media may include In a base band or as the data-signal that carrier wave a part is propagated, wherein carrying computer-readable program code.It is this The data-signal of propagation can take various forms, including but not limited to electromagnetic signal, optical signal or above-mentioned any appropriate Combination.Computer-readable signal media can also be any computer-readable medium other than computer readable storage medium, should Computer-readable signal media can send, propagate or transmit for by instruction execution system, device or device use or Person's program in connection.The program code for including on computer-readable medium can transmit with any suitable medium, Including but not limited to: electric wire, optical cable, RF (radio frequency) etc. or above-mentioned any appropriate combination.
Above-mentioned computer-readable medium can be included in above-mentioned electronic equipment;It is also possible to individualism, and not It is fitted into the electronic equipment.Above-mentioned computer-readable medium carries one or more program, when said one or more When a program is executed by the electronic equipment, so that the electronic equipment: creation qcow2 file, and start the void for having qcow2 file The mirroring agent virtual machine of quasi- disk;The virtual disk of qcow2 file is mounted to first specified in mirroring agent virtual machine Mirror image catalogue;The the first mirror image catalogue for being mirrored to and specifying in mirroring agent virtual machine is pulled from container image source;To qcow2 file It does snapshot and generates qcow2 snapshot document;Start lightweight virtual machine, and qcow2 snapshot document is invented into lightweight virtual machine Disk and carry to lightweight virtual machine;The virtual disk of qcow2 snapshot document is mounted in lightweight virtual machine and is specified The second mirror image catalogue.
The behaviour for executing embodiment of the disclosure can be write with one or more programming languages or combinations thereof The computer program code of work, described program design language include object oriented program language-such as Java, Smalltalk, C++ further include conventional procedural programming language-such as " C " language or similar program design language Speech.Program code can be executed fully on the user computer, partly be executed on the user computer, as an independence Software package execute, part on the user computer part execute on the remote computer or completely in remote computer or It is executed on server.In situations involving remote computers, remote computer can pass through the network of any kind --- packet It includes local area network (LAN) or wide area network (WAN)-is connected to subscriber computer, or, it may be connected to outer computer (such as benefit It is connected with ISP by internet).
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the disclosure, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction Combination realize.
Being described in unit involved in embodiment of the disclosure can be realized by way of software, can also be passed through The mode of hardware is realized.Described unit also can be set in the processor, for example, can be described as: a kind of processor Including creating unit, the first carry unit, pull unit, the first snapshot unit, the first dummy unit and the second carry unit.Its In, the title of these units does not constitute the restriction to the unit itself under certain conditions, for example, creating unit can also quilt Be described as " creation qcow2 file, and start the list of the mirroring agent virtual machine of the virtual disk with the qcow2 file Member ".
Above description is only the preferred embodiment of the disclosure and the explanation to institute's application technology principle.Those skilled in the art Member is it should be appreciated that invention scope involved in the disclosure, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic Scheme, while should also cover in the case where not departing from the inventive concept, it is carried out by above-mentioned technical characteristic or its equivalent feature Any combination and the other technical solutions formed.Such as features described above has similar function with (but being not limited to) disclosed in the disclosure Can technical characteristic replaced mutually and the technical solution that is formed.

Claims (14)

1. a kind of method for managing container mirror image, comprising:
Qcow2 file is created, and starts the mirroring agent virtual machine of the virtual disk with the qcow2 file;
The virtual disk of the qcow2 file is mounted to the first mirror image catalogue specified in the mirroring agent virtual machine;
The the first mirror image catalogue for being mirrored to and specifying in the mirroring agent virtual machine is pulled from container image source;
Snapshot is done to the qcow2 file and generates qcow2 snapshot document;
Start lightweight virtual machine, and disk and carry that the qcow2 snapshot document is invented lightweight virtual machine are to institute State lightweight virtual machine;
The virtual disk of the qcow2 snapshot document is mounted to the second mirror image catalogue specified in the lightweight virtual machine.
2. according to the method described in claim 1, wherein, the method also includes:
The mirror image that the lightweight virtual machine uses is pushed to the second mirror image catalogue specified in the lightweight virtual machine;
Snapshot is done to the qcow2 file in the second mirror image catalogue and generates target qcow2 file;
By the target qcow2 file invent the mirroring agent virtual machine disk and carry to the mirroring agent it is virtual Machine;
The virtual disk of the target qcow2 file is mounted to the first mirror image mesh specified in the mirroring agent virtual machine Record.
3. according to the method described in claim 1, wherein, the creation qcow2 file, comprising:
The qcow2 file of specified size is created, and the qcow2 file format is melted into specified file system.
4. according to the method described in claim 1, wherein, the method also includes:
Adjust the size of the qcow2 file.
5. according to the method described in claim 1, wherein, the method also includes:
The qcow2 file is encrypted.
6. according to the method described in claim 1, wherein, the method also includes:
The qcow2 file is compressed.
7. a kind of for managing the device of container mirror image, comprising:
Creating unit is configured to create qcow2 file, and starts the mirror image generation of the virtual disk with the qcow2 file Manage virtual machine;
First carry unit is configured to for the virtual disk of the qcow2 file being mounted in the mirroring agent virtual machine The first specified mirror image catalogue;
Unit is pulled, is configured to pull the first mirror image for being mirrored to and specifying in the mirroring agent virtual machine from container image source Catalogue;
First snapshot unit is configured to make the qcow2 file snapshot and generates qcow2 snapshot document;
First dummy unit is configured to start lightweight virtual machine, and the qcow2 snapshot document is invented lightweight void The disk and carry of quasi- machine give the lightweight virtual machine;
Second carry unit is configured to the virtual disk of the qcow2 snapshot document being mounted to the lightweight virtual machine In specify the second mirror image catalogue.
8. device according to claim 7, wherein described device further include:
Push unit is configured to for the mirror image that the lightweight virtual machine uses being pushed in the lightweight virtual machine and specify The second mirror image catalogue;
Second snapshot unit is configured to make the qcow2 file in the second mirror image catalogue snapshot and generates target qcow2 text Part;
Second dummy unit is configured to the target qcow2 file inventing the disk of the mirroring agent virtual machine simultaneously Carry gives the mirroring agent virtual machine;
The first carry unit is further configured to the virtual disk of the target qcow2 file being mounted to the mirror image The the first mirror image catalogue specified in Agent virtual machine.
9. device according to claim 7, wherein the creating unit is further configured to:
The qcow2 file of specified size is created, and the qcow2 file format is melted into specified file system.
10. device according to claim 7, wherein described device further includes adjustment unit, is configured to:
Adjust the size of the qcow2 file.
11. device according to claim 7, wherein described device further includes encryption unit, is configured to:
The qcow2 file is encrypted.
12. device according to claim 7, wherein described device further includes compression unit, is configured to:
The qcow2 file is compressed.
13. a kind of electronic equipment, comprising:
One or more processors;
Storage device is stored thereon with one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real The now method as described in any in claim 1-7.
14. a kind of computer-readable medium, is stored thereon with computer program, wherein real when described program is executed by processor The now method as described in any in claim 1-7.
CN201910602797.5A 2019-07-05 2019-07-05 Method and apparatus for managing container mirror image Pending CN110308972A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910602797.5A CN110308972A (en) 2019-07-05 2019-07-05 Method and apparatus for managing container mirror image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910602797.5A CN110308972A (en) 2019-07-05 2019-07-05 Method and apparatus for managing container mirror image

Publications (1)

Publication Number Publication Date
CN110308972A true CN110308972A (en) 2019-10-08

Family

ID=68079082

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910602797.5A Pending CN110308972A (en) 2019-07-05 2019-07-05 Method and apparatus for managing container mirror image

Country Status (1)

Country Link
CN (1) CN110308972A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111782339A (en) * 2020-06-28 2020-10-16 京东数字科技控股有限公司 Container creation method and device, electronic equipment and storage medium
CN113190325A (en) * 2021-04-09 2021-07-30 大唐微电子技术有限公司 Container creation method and device
CN113296887A (en) * 2021-03-31 2021-08-24 阿里巴巴新加坡控股有限公司 Method and device for starting safety container
CN113360244A (en) * 2021-05-13 2021-09-07 烽火通信科技股份有限公司 Remote container mirror image application method, system and equipment
CN113407296A (en) * 2020-03-16 2021-09-17 阿里巴巴集团控股有限公司 Container service management method and device
CN113504872A (en) * 2021-05-14 2021-10-15 济南浪潮数据技术有限公司 Method, system, equipment and medium for mounting virtual disk on cloud physical machine
CN114281480A (en) * 2021-12-27 2022-04-05 长春吉大正元信息技术股份有限公司 Container mirror image file processing method, device, equipment and storage medium

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113407296A (en) * 2020-03-16 2021-09-17 阿里巴巴集团控股有限公司 Container service management method and device
CN111782339A (en) * 2020-06-28 2020-10-16 京东数字科技控股有限公司 Container creation method and device, electronic equipment and storage medium
CN111782339B (en) * 2020-06-28 2024-04-12 京东科技控股股份有限公司 Container creation method and device, electronic equipment and storage medium
CN113296887A (en) * 2021-03-31 2021-08-24 阿里巴巴新加坡控股有限公司 Method and device for starting safety container
WO2022206230A1 (en) * 2021-03-31 2022-10-06 阿里巴巴(中国)有限公司 Method and apparatus for starting secure container
CN113296887B (en) * 2021-03-31 2023-12-08 阿里巴巴(中国)有限公司 Method and device for starting safety container
CN113190325A (en) * 2021-04-09 2021-07-30 大唐微电子技术有限公司 Container creation method and device
CN113360244A (en) * 2021-05-13 2021-09-07 烽火通信科技股份有限公司 Remote container mirror image application method, system and equipment
CN113504872A (en) * 2021-05-14 2021-10-15 济南浪潮数据技术有限公司 Method, system, equipment and medium for mounting virtual disk on cloud physical machine
CN113504872B (en) * 2021-05-14 2023-11-03 济南浪潮数据技术有限公司 Method, system, equipment and medium for mounting virtual disk on cloud physical machine
CN114281480A (en) * 2021-12-27 2022-04-05 长春吉大正元信息技术股份有限公司 Container mirror image file processing method, device, equipment and storage medium
CN114281480B (en) * 2021-12-27 2022-12-13 长春吉大正元信息技术股份有限公司 Container mirror image file processing method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110308972A (en) Method and apparatus for managing container mirror image
US10360536B2 (en) Implementing a consistent ordering of operations in collaborative editing of shared content items
CN108549673A (en) Pre-add support method, client, server and the network system of web page resources
CN110286927A (en) Hot update method, device and the equipment of Flutter application
WO2020216204A1 (en) Information acquisition method and apparatus
CN110389796A (en) Edit operation processing method, device and electronic equipment
CN105141632B (en) Method and apparatus for checking the page
WO2020216310A1 (en) Method used for generating application, terminal device, and computer readable medium
WO2019029451A1 (en) Method for publishing mobile applications and electronic apparatus
WO2022184077A1 (en) Document editing method and apparatus, and terminal and non-transitory storage medium
CN110119386A (en) Data processing method, data processing equipment, medium and calculating equipment
CN109918146A (en) Page generation method and device
CN109726217A (en) A kind of database operation method, device, equipment and storage medium
WO2023186130A1 (en) Information display method and apparatus, information sending method and apparatus, device, medium, and product
CN110070592A (en) Generation method, device and the hardware device of special efficacy packet
CN107402846A (en) Document handling method and device
WO2024093576A1 (en) Information processing method and apparatus, and electronic device and storage medium
CN111209205B (en) Configuration method, configuration device and electronic equipment
CN108984260B (en) Method and apparatus for handling information
CN115220716A (en) Code generation method and device, electronic equipment and storage medium
CN111193785B (en) File cutting and transmitting method and device and electronic equipment
CN114860213A (en) Application package generation method, device, equipment and medium
CN110019059A (en) A kind of method and apparatus of Timing Synchronization
CN113760279A (en) Method and device for generating page
CN112241999A (en) Image generation method, device, equipment and computer readable medium

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