CN113672334A - Container management method and device - Google Patents
Container management method and device Download PDFInfo
- Publication number
- CN113672334A CN113672334A CN202110154518.0A CN202110154518A CN113672334A CN 113672334 A CN113672334 A CN 113672334A CN 202110154518 A CN202110154518 A CN 202110154518A CN 113672334 A CN113672334 A CN 113672334A
- Authority
- CN
- China
- Prior art keywords
- container
- command line
- daemon
- line tool
- mirror image
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
- G06F8/63—Image based installation; Cloning; Build to order
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
- G06F9/5016—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45562—Creating, deleting, cloning virtual machine instances
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45575—Starting, stopping, suspending or resuming virtual machine instances
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45583—Memory management, e.g. access or allocation
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a container management method and a device, wherein the method comprises the steps of operating a container and a mirror image by adopting a command line tool; after the container is started, triggering a container daemon program for recording the input and output of the container and the log information to be in an operating state; and after the container is stopped, triggering the container daemon to exit the running state. The command line tool provides user interactive programs on the command line interface, the programs finish running after the task execution is finished, and the control right is returned to the command line interface without running background service, so that the occupancy rate of system memory and CPU resources is reduced; the executable file of the command line tool is a Linux platform code and can be executed without language operation, so that the method is more efficient, has less requirement on memory resources, and is further suitable for the Internet of things equipment with limited memory resources.
Description
Technical Field
The present invention relates to the field of computer application systems, and in particular, to a method and an apparatus for managing containers.
Background
Container (Linux Container) is a system-level virtualization technique. The container isolates different processes to separate environments through resource isolation and management and control technologies provided by an operating system, such as CGroup and Namesspace in Linux, so that virtualization is realized. Unlike hardware virtualization technology (Hypervisor), the container and the host share the system kernel, and do not need to simulate hardware, so the container is lighter in weight.
The Linux fund establishes an open Container specification-oci (open Container initiative) organization in 2015 6, and aims to establish an open industrial standard around Container formats and operation; at present, there are mainly container runtime specifications (runtime spec) and image specifications (image spec), and distribution specifications (distribution spec) that have not yet been fully standardized. The mirror image specification summarizes JSON content of the mirror image used in the operation of the container and the relation between the mirror image and a file system change set; the container runtime specification defines the configuration information, execution environment and life cycle of the container; the distribution specification defines the API protocol format in which the container distributes content.
The Docker container engine is a container management tool that is currently in widespread use. Although Docker has advanced the development of container technology, it still has some problems. Docker adopts a working mode of a client/server, wherein the client provides an operation interface for a user and the server executes a specific task; the client sends the input data of the user to the server and outputs the result processed by the server; therefore, the server needs to keep running to respond to the task request of the client at any time. In particular, for Docker, the server needs to record container logs and statuses, and stopping the server will cause all containers to terminate, so even if the user only performs some operations that do not affect the container statuses, such as listing all containers and mirrors, the server needs to start and keep running with the host, resulting in high occupancy rates on system memory and CPU resources. In addition, Docker adopts Go language to compile, and the memory demand is great in the runtime, is not suitable for the thing networking equipment that the memory resource is limited.
Disclosure of Invention
In view of this, the present invention provides a container management method and a container management technique, which are intended to reduce the occupancy rate of system memory and CPU resources and are suitable for internet of things devices with limited memory resources.
In order to achieve the above object, the following solutions are proposed:
in a first aspect, a container management method is provided, including:
adopting a Command Line tool to operate the container and the mirror image, wherein the Command Line tool is a program providing user interaction on a Command Line Interface (Command Line Interface), and an executable file of the Command Line tool is a Linux platform code;
after the container is started, triggering a container daemon program for recording the input and output of the container and the log information to be in an operating state;
and after the container is stopped, triggering the container daemon to exit the running state.
Preferably, crun is used as the container runtime.
Preferably, the container daemon is, in particular, Conmon.
Preferably, the container warehouse and the mirror image warehouse involved in the operation of the container and the mirror image are designed by using UML class diagrams.
Preferably, operating the container comprises: create, start, stop, attach, clear, list, and delete;
operating the mirror image: including pulling, building, listing, and deleting.
In a second aspect, there is provided a container management apparatus comprising:
the system comprises a command line tool unit, a storage unit and a mirror image processing unit, wherein the command line tool unit is used for operating a container and a mirror image by adopting a command line tool, the command line tool is a program for providing user interaction on a command line interface, and an executable file of the command line tool is a Linux platform code;
the container daemon operation unit is used for triggering a container daemon program for recording container input and output and log information to be in an operation state after the container is started;
and the container daemon stopping unit is used for triggering the container daemon to exit the running state after the container is stopped.
Preferably, crun is used as the container runtime.
Preferably, the container daemon is, in particular, Conmon.
Preferably, the container warehouse and the mirror image warehouse involved in the operation of the container and the mirror image are designed by using UML class diagrams.
Preferably, operating the container comprises: create, start, stop, attach, clear, list, and delete;
operating the mirror image: including pulling, building, listing, and deleting.
Compared with the prior art, the technical scheme of the invention has the following advantages:
the method comprises the steps of operating the container and the mirror image by adopting a command line tool; after the container is started, triggering a container daemon program for recording the input and output of the container and the log information to be in an operating state; and after the container is stopped, triggering the container daemon to exit the running state. The command line tool provides user interactive programs on the command line interface, the programs finish running after the task execution is finished, and the control right is returned to the command line interface without running background service, so that the occupancy rate of system memory and CPU resources is reduced; the executable file of the command line tool is a Linux platform code and can be executed without language operation, so that the method is more efficient, has less requirement on memory resources, and is further suitable for the Internet of things equipment with limited memory resources.
Run with crun as a container. crun is a lightweight container runtime written in C language that conforms to the OCI specification. Compared with other container operation, such as runc, cri-o and the like, the crun has higher performance and lower memory occupancy rate, and is more suitable for resource-limited equipment in the Internet of things.
Conmon was used as the container daemon. Conmon is also compiled by adopting C language, compared with other container daemon programs such as container-shim and the like, the container daemon has the characteristics of high efficiency and low memory occupation, is the smallest daemon process which can be owned in the container operation process, and is more suitable for equipment with limited resources in the Internet of things.
Of course, it is not necessary for any product in which the invention is practiced to achieve all of the above-described advantages at the same time.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a container management method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a command line tool according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a UML class diagram design of a container warehouse and a mirror warehouse provided in an embodiment of the present invention;
FIG. 4 is a diagram illustrating mirror related functionality provided by an embodiment of the present invention;
FIG. 5 is a schematic diagram of the related functions of a container provided by an embodiment of the present invention;
fig. 6 is a schematic logical structure diagram of a container management apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Aiming at the problems that a container management tool widely applied at present has high memory occupancy rate, needs to keep a background running and is not suitable for resource-limited equipment in the environment of the Internet of things, the invention provides a container management method without a background daemon process, which comprises the following steps:
s11: operating the container and the mirror image by adopting a command line tool; the command line tool is a program that provides user interaction at a command line interface; the executable file of the command line tool is Linux platform code.
The container operation comprises creating, starting, stopping, attaching, cleaning, listing, deleting and the like; operations on the image include pulling, building, listing, deleting, and the like. After a user inputs a corresponding command on a command line interface, a command line tool executes container operation or mirror image operation, such as container creation, mirror image deletion, mirror image pulling and the like; after the operation is completed, such as the container creation is completed and the mirror image is successfully deleted, the command line tool ends the operation and returns the control right to the command line interface.
The invention directly executes the related functions after acquiring the container or mirror image configuration information, and immediately exits after the execution is finished without any background service, so the invention has smaller demand on the memory resource. For example, on the ubuntu18.04 system, after starting the same container, the memory occupied by Docker is about 100MB, while the inventive program is only about 2MB (containing no container processes). The command line tool can be written by C + +, and the generated executable file is a Linux platform code and can be executed without language operation, so that the method is more efficient.
In the process of operating the container and the mirror image, the command line tool adopted by the embodiment uses other open source software to realize functions such as network request, data extraction and the like. The sub-functions included in the command line tool adopted in the embodiment are similar to those of Docker in terms of parameters, but for the functions related to the container, such as container starting, container adding, container deleting and the like, the command line tool adopted in the embodiment can execute the functions only by acquiring the information of the container, and Docker needs to interact with the background service thereof, and sends the command and the container information to the background service to execute and obtain output, so that the command line tool adopted in the embodiment can remarkably reduce the use of system memory and CPU resources when the same functions are realized.
S12: and after the container is started, triggering a container daemon program for recording the input and output of the container and the log information to be in a running state.
In some embodiments, Conmon is employed as the container daemon. Compared with other container daemon programs such as container daemon-shim programs and the like, Conmon is compiled by C language, has the characteristics of high efficiency and low memory occupation, is the smallest daemon process which can be owned in the container operation process, and is more suitable for equipment with limited resources in the Internet of things.
S13: and after the container is stopped, triggering the container daemon to exit the running state.
In some embodiments, crun is used as a container runtime. The container operation is the core of the operation container, at present, runc, cri-o, crun and the like are used more, and in the embodiment, when crun is used as the container operation, compared with other container operations, crun has lower requirements on equipment resources and is more efficient, and the method is more suitable for equipment with limited resources in the internet of things.
FIG. 2 illustrates a process for operating on containers and images using a command line tool involving multiple entities, where remote repository refers to a common mirror storage repository that conforms to the image distribution specification; the mirror image warehouse is a database which is created in the process of operating the mirror image and used for storing mirror image information; the container warehouse is a database created during the operation of the container for the container information. The container running process is stored as data that the container needs to hold after starting, such as an attachable socket sock, pid of the container process, and the like. A container daemon common for managing a log of the container, providing a socket, and the like; the container runtime crun is the execution engine of the container. The container tool is the command line tool described above.
The mirror image operation comprises the functions of pulling, constructing, listing and deleting mirror images, and the functions are mainly interacted with a remote warehouse and a mirror image warehouse; container operations include create, start, stop, append, clean, list, and delete container functions that interact primarily with the container warehouse, container runtime storage, and common.
In some embodiments, the container warehouse and the mirror warehouse, both of which are involved in the present invention, employ the UML class diagram design shown in fig. 3. Specifically, the warehouse Repo and the warehouse item RepoItem are base classes, and provide a basic database operation function meeting RAII (resource acquisition, namely initialization). The container warehouse containerrpoo and the mirror image warehouse ImageRepo respectively provide operations of querying, updating, deleting and the like for the container and the mirror image; the container warehouse item containerepoitem and the mirror warehouse item imageRepoitem corresponding to the container warehouse item containerepoitem and the mirror warehouse item ImageRepoitem are respectively the related information of the container and the mirror to be stored. The container warehouse item containerepoitem includes a running state, an identification, a name, an execution command, and the like of the container; the mirror repository item ImageRepoItem includes a mirror identification, a name, a tag, a creation time, and the like. The container status ContainerStatus provides the specific status of the container, including three valid statuses of created, stopped, and running, and invalid status. The ImageIDRepo and the ImageIDRepoItem provide a function of mutually indexing the mirror name and the mirror identifier so as to quickly acquire the mirror identifier through the name.
The specific process of using the command line tool to operate on containers and mirrors is described in detail below in conjunction with fig. 4 and 5:
1. and pulling the mirror image, namely pulling the mirror image from the default remote warehouse and storing the mirror image in the mirror image warehouse. The method mainly comprises two steps of obtaining mirror image data and storing mirror images. Acquiring mirror image data needs to refer to a mirror image distribution specification and other related documents, and the method mainly comprises the steps of acquiring a mirror image manifest file manifest. And saving the list configuration file of the mirror image, and updating the mirror image warehouse. For the image distribution specification v1, the manifest file contains the relevant configuration file, and for the image distribution specification v2, the configuration file needs to be acquired through the corresponding interface. The manifest file comprises an identifier of each layer of the image, and the compressed file data of each layer is obtained through the identifier.
2. And (4) building the image, namely creating the image by using the specified building file written by the user. Specifically, the manifest file and the configuration file of the base image are loaded first, then different operations are executed according to the content in the constructed file, such as copying a certain file to the storage location of the image, adding an environment variable to the configuration information of the image, changing a default start command of the image, and the like, and then the modified manifest data and configuration data are written into the storage location of the image, and the information in the image repository is updated.
The construction mirror image in this embodiment supports the following syntax:
a)FROM<image>:<tag>
b)CMD["executable","param1","param2"]
c) COPY < src > < dest > may specify a plurality of
d) ENV < key > < value > may specify a plurality of
Wherein, CMD and ENV can be obtained by modifying the configuration file of the mirror image; COPY may be implemented by creating a new diff directory in the mirror directory. The method comprises the specific steps of acquiring a file, generating a mirror name and an ID, creating a mirror directory, reading a basic mirror FROM, loading content of a container _ config in a basic mirror configuration file as configuration information, reading file lines and analyzing each line, and generating a list file to update a mirror database.
3. Mirror is listed, i.e., the contents of the mirror repository are read, formatted, and printed.
4. And deleting the mirror image, namely acquiring the ID of the mirror image according to the name of the mirror image, reading the container database to judge whether the mirror image is used or not, deleting the relevant files of the mirror image if the mirror image is not used, wherein the relevant files comprise a deletion list, a configuration file, a layer only referred by the current mirror image and the like, updating the mirror image database (namely deleting the corresponding mirror image file from the mirror image warehouse), and otherwise, prompting and exiting.
5. Creating a container, namely using the layer of a given image as a file system of the container and using the contetienr _ config data in the image configuration file as a configuration file of the container, generating a folder required by the container operation and updating a container warehouse. The method comprises the specific steps of obtaining a mirror image configuration file, generating a container OCI configuration file, generating a lower directory file, creating directories to be mounted, namely merge, upper, lower and diff, copying to a corresponding container directory if the mirror image directory contains the diff directory, updating a container database and updating the mirror image database. When a container OCI configuration file is generated, the file path of the OCI configuration netns is updated, and the command, the environment and the hostname are updated.
Creating a container using the image and executing a program therein, a name of the created container, a program to be executed may be specified. The command actually consists of two steps, creation and initiation, and when creating the container, the executive program of the container configuration file needs to be changed according to the args parameter.
Creating a container start container requires creating a device and Namespace associated with a network and mounting an overlay file system to a corresponding directory. The Network Namespace is an operating system function on which container technology depends. The newly created network name space is equivalent to a brand-new network protocol stack, which does not contain any network device, and if network support is provided for the newly created network name space, a virtual network card device needs to be created and added into the created network name space. In addition, the virtual network card is independent of the physical network card, so that data forwarding needs to be performed by modifying a routing table or in a bridging manner in order to transmit and receive internet traffic.
The overlay file system is an implementation of a Linux combined file system. It merges a number of different base load points into one, thereby creating a single directory structure containing all source directories and sub-directories. The Overlay file system allows different containers to share a layer and can record changes to the file system by container processes. For example, if two different images have some layer in common, then when two images are used to run the container, only these layers need to be mounted (mount) to the container storage directory without any copy. Changes to these layers during the operation of the container can also be written into the storage location of the container, and the original layers are not affected.
6. The containers are listed, i.e., the data is read from the container warehouse, formatted, and printed.
7. And deleting the container, namely firstly reading the container warehouse item to check whether the container is in a running state, if not, deleting the configuration file and the to-be-mounted folder required by the running of the container, and then deleting the container from the container warehouse.
8. Starting the container, firstly obtaining the container information to ensure that the container and the container are not operated, then creating a network name space and network equipment, and configuring a routing table in a bridging mode. After the completion, the layer of the container is mounted to the container catalog, and the common is called to start the container. When the common is called, the cleaning program after the container exits can be configured, and the cleaning program is responsible for unloading the mounted files, cleaning network equipment, a name space and the like. And the common calls the create of the container and returns the pid of the container as data, after the creation is finished, the create start is called to start the container, and then the container database is updated, namely all processes for starting the container are finished.
It should be noted that, when synchronizing with the conmon, the conmon creates a container through the create, but does not start the container, so the create start needs to be called after the create, and the conmon notifies the parent process of the completion of the creation of the container by obtaining the pipe file descriptor named _ OCI _ syncipe from the environment variable, and the format is { "data": pid }.
10. An additional socket attached to, i.e. acquiring, the container, forwards the user's input to the container standard input and the output of the container process to the standard output, which when executed requires the terminal to be set in raw mode to ensure that the user output is not intercepted by the current terminal. The concon automatically creates a unix socket named attach, type SOCK _ SEQPACKET, through which it can be implemented. The method comprises the specific steps of acquiring and connecting a socket, setting a terminal to be in a raw mode, monitoring events of the socket and standard input by using epoll, forwarding the standard input to the socket, forwarding the return content of the socket to the terminal, judging according to the first character of response content, wherein 2 represents stdout, 3 represents stderr, and since the connon does not call clearend when a container process (attach container and exit) is attached and terminated, if the socket is disconnected, stopping and cleaning the container.
11. Stopping the container, namely, sending SIGTERM and SIGKILL signals to the container process pid, if the process does not respond to SIGTERM or responds but does not terminate, sending the SIGKILL signal to force the container process to end. The method comprises the specific steps of acquiring a container process PID, sending a SIGTERM signal, judging whether proc and PID exist (namely whether the proc and PID are finished) after time-out, and sending a SIGKILL signal if the proc and PID exist. After the container process is finished, the connon automatically calls clean to update the container database.
12. And cleaning the container, namely cleaning the related file of the container, wherein the related file comprises the socket and the FIFO created by the common, cleaning the mount point, deleting the network name space, deleting the virtual network card, deleting the container in operation and updating the container database.
While, for purposes of simplicity of explanation, the foregoing method embodiments have been described as a series of acts or combination of acts, it will be appreciated by those skilled in the art that the present invention is not limited by the illustrated ordering of acts, as some steps may occur in other orders or concurrently with other steps in accordance with the invention.
The following are embodiments of the apparatus of the present invention that may be used to perform embodiments of the method of the present invention. For details which are not disclosed in the embodiments of the apparatus of the present invention, reference is made to the embodiments of the method of the present invention.
Referring to fig. 6, the container management apparatus provided for this embodiment includes: a command line tool unit 61, a container daemon operation unit 62, and a container daemon halting unit 63.
A command line tool unit 61 for operating on containers and mirrors using command line tools; the command line tool is a program that provides user interaction at a command line interface; the executable file of the command line tool is Linux platform code.
And a container daemon running unit 62, configured to trigger a container daemon used for recording container input and output and log information to be in a running state after the container is started.
And the container daemon stopping unit 63 is used for triggering the container daemon to exit the running state after the container is stopped.
In some embodiments, crun is used as a container runtime.
In some embodiments, the container daemon is specifically Conmon.
In some embodiments, the container warehouse and the mirror warehouse involved in the operation of the container and the mirror are designed by using a UML class diagram.
In some embodiments, manipulating containers includes creating, starting, stopping, appending, cleaning, listing, and deleting; operating on the mirror including pulling, building, listing, and deleting
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
In this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present description are mainly described as different from other embodiments, the same and similar parts in the embodiments may be referred to each other, and the features described in the embodiments in the present description may be replaced with each other or combined with each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (10)
1. A method of container management, comprising:
adopting a command line tool to operate the container and the mirror image, wherein the command line tool is a program for providing user interaction on a command line interface, and an executable file of the command line tool is a Linux platform code;
after the container is started, triggering a container daemon program for recording the input and output of the container and the log information to be in an operating state;
and after the container is stopped, triggering the container daemon to exit the running state.
2. The container management method according to claim 1, wherein crun is adopted as a container runtime.
3. The container management method according to claim 1, wherein the container daemon specifically is:
Conmon。
4. the container management method according to claim 1, wherein the container warehouse and the mirror warehouse involved in the operation of the container and the mirror are designed by using a UML class diagram.
5. The container management method according to any one of claims 1 to 4, wherein operating the container comprises: create, start, stop, attach, clear, list, and delete;
operating the mirror image: including pulling, building, listing, and deleting.
6. A container management apparatus, comprising:
the system comprises a command line tool unit, a storage unit and a mirror image processing unit, wherein the command line tool unit is used for operating a container and a mirror image by adopting a command line tool, the command line tool is a program for providing user interaction on a command line interface, and an executable file of the command line tool is a Linux platform code;
the container daemon operation unit is used for triggering a container daemon program for recording container input and output and log information to be in an operation state after the container is started;
and the container daemon stopping unit is used for triggering the container daemon to exit the running state after the container is stopped.
7. The container management apparatus according to claim 6, wherein crun is adopted as a container runtime.
8. The container management device according to claim 6, wherein the container daemon is specifically:
Conmon。
9. the container management apparatus according to claim 6, wherein the container warehouse and the mirror warehouse involved in the operation of the container and the mirror are designed by using UML class diagrams.
10. The apparatus according to any one of claims 6 to 9, wherein the operation of the container comprises: create, start, stop, attach, clear, list, and delete;
operating the mirror image: including pulling, building, listing, and deleting.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110154518.0A CN113672334A (en) | 2021-02-04 | 2021-02-04 | Container management method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110154518.0A CN113672334A (en) | 2021-02-04 | 2021-02-04 | Container management method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113672334A true CN113672334A (en) | 2021-11-19 |
Family
ID=78538038
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110154518.0A Pending CN113672334A (en) | 2021-02-04 | 2021-02-04 | Container management method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113672334A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114721784A (en) * | 2022-05-19 | 2022-07-08 | 龙芯中科技术股份有限公司 | Application running method and device, electronic equipment and readable medium |
-
2021
- 2021-02-04 CN CN202110154518.0A patent/CN113672334A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114721784A (en) * | 2022-05-19 | 2022-07-08 | 龙芯中科技术股份有限公司 | Application running method and device, electronic equipment and readable medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3428811B1 (en) | Database interface agent for a tenant-based upgrade system | |
JP2779587B2 (en) | Apparatus and method for making part of a namespace used for a computer system available as part of another namespace | |
US6148323A (en) | System and method for managing the execution of system management | |
US6334158B1 (en) | User-interactive system and method for integrating applications | |
CN111338854B (en) | Kubernetes cluster-based method and system for quickly recovering data | |
US7945531B2 (en) | Interfaces for a productivity suite application and a hosted user interface | |
US8584081B2 (en) | Server side application integration framework | |
US7203774B1 (en) | Bus specific device enumeration system and method | |
US20030195951A1 (en) | Method and system to dynamically detect, download and install drivers from an online service | |
US20130117676A1 (en) | Visually analyzing, clustering, transforming and consolidating real and virtual machine images in a computing environment | |
US20220109605A1 (en) | Implementing Affinity and Anti-Affinity with Kubernetes | |
US20150089408A1 (en) | Method and framework for content viewer integrations | |
US11144292B2 (en) | Packaging support system and packaging support method | |
CN111651219A (en) | Method and equipment for managing multi-module project configuration file | |
JP2001175460A (en) | Program distribution management system | |
CN113672334A (en) | Container management method and device | |
CN111367804B (en) | Method for realizing front-end cooperative debugging based on cloud computing and network programming | |
CN115357198B (en) | Mounting method and device of storage volume, storage medium and electronic equipment | |
CN113535254A (en) | Micro-service processing method, micro-service deployment method and related device | |
US20110029856A1 (en) | Extensible Web Context in Web Containers | |
CN110837394A (en) | High-availability configuration version warehouse configuration method, terminal and readable medium | |
JP4060890B2 (en) | File system primitives that allow reprocessing of I / O requests by multiple drivers in a hierarchical driver I / O system | |
CN113535188A (en) | Privatization deployment method and device | |
CN113626007B (en) | Application method and device of connector model and server | |
US6032176A (en) | Data-independent type computer system: processing machine, data machine and man-machine interface therein |
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 |