CN110727503A - Container deployment method, device, equipment, storage medium and container deployment system - Google Patents

Container deployment method, device, equipment, storage medium and container deployment system Download PDF

Info

Publication number
CN110727503A
CN110727503A CN201910987477.6A CN201910987477A CN110727503A CN 110727503 A CN110727503 A CN 110727503A CN 201910987477 A CN201910987477 A CN 201910987477A CN 110727503 A CN110727503 A CN 110727503A
Authority
CN
China
Prior art keywords
container
target
mirror image
target container
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.)
Granted
Application number
CN201910987477.6A
Other languages
Chinese (zh)
Other versions
CN110727503B (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.)
Hkust Technology (suzhou) Technology Co Ltd
Original Assignee
Hkust Technology (suzhou) 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 Hkust Technology (suzhou) Technology Co Ltd filed Critical Hkust Technology (suzhou) Technology Co Ltd
Priority to CN201910987477.6A priority Critical patent/CN110727503B/en
Publication of CN110727503A publication Critical patent/CN110727503A/en
Application granted granted Critical
Publication of CN110727503B publication Critical patent/CN110727503B/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
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • 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
    • 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/4557Distribution of virtual machine instances; Migration and load balancing

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 Transfer Between Computers (AREA)

Abstract

The application provides a container deployment method, a device, equipment, a storage medium and a container deployment system, wherein a web client acquires a target container mirror image derived from a container warehouse in a research and development environment and uploads the target container mirror image to a web server; the web server pushes the target container mirror image to a target machine in the production environment, and deploys the target container on the target machine according to the target container mirror image. The container deployment method is not only suitable for a closed local area network environment, but also simple in implementation process, low in manual participation degree and high in container deployment efficiency.

Description

Container deployment method, device, equipment, storage medium and container deployment system
Technical Field
The present application relates to the field of computer technologies, and in particular, to a container deployment method, apparatus, device, storage medium, and container deployment system.
Background
The micro-service architecture is an architecture mode, and advocates dividing a single application program into a group of small services, and the services are mutually coordinated and matched to provide final value for users. Each service runs in an independent process, the services are communicated with each other by adopting a lightweight communication mechanism, and each service is constructed around a specific service and can be independently deployed into a production environment and a production-like environment.
The Docker container is an open source application container engine that allows developers to package their applications and dependencies into a portable container and then distribute them to any Linux machine. The container uses a full-use sandbox mechanism, has no interfaces with each other, has little performance overhead, can be easily run in machines and data centers, and most importantly, the container is independent of any language, framework and system.
In one scenario, a container image in a development environment needs to be pushed onto a machine to be deployed in a production environment, and then the container needs to be deployed on the machine to be deployed. However, in some closed lan environments, the development environment and the production environment are not communicated, which results in that the container image cannot be pushed to the machine to be deployed in the production environment, and even the container cannot be deployed on the machine to be deployed.
Disclosure of Invention
In view of this, the present application provides a container deployment method, device, apparatus, storage medium, and container deployment system, so as to solve the problem that in some closed local area network environments, a development environment and a production environment are not communicated, so that a container image cannot be pushed to a machine to be deployed in the production environment, and even cannot be deployed on the machine to be deployed, and a technical scheme of the method is as follows:
a container deployment method applied to a web server comprises the following steps:
receiving a target container mirror image uploaded by a web client, wherein the target container mirror image is exported from a container warehouse in a development environment;
pushing the target container mirror image to a target machine in a production environment;
deploying a target container on the target machine according to the target container image.
Optionally, a Docker service is deployed on the target machine;
the pushing the target container image to a target machine in a production environment, comprising:
and directly pushing the target container mirror image to a target machine in the production environment, so that the target machine acquires the target container mirror image through a remote access interface of the Docker service.
Optionally, the pushing the target container image to a target machine in a production environment includes:
reading the mirror image of the target container to the local;
pushing the target container mirror image read to the local to a container warehouse which is deployed in the production environment in advance;
and pulling the target container mirror image from a container warehouse deployed in the production environment, and pushing the pulled target container mirror image to a target machine in the production environment.
Optionally, the receiving the container image uploaded by the web client includes:
and when a container mirror image uploading request initiated by the web client is received, calling an uploading interface, and receiving the target container mirror image uploaded by the web client.
Optionally, the container deployment method further includes:
in the process of uploading the target container mirror image, feeding back the uploading progress of the target container mirror image to the web client;
and when the target container mirror image is uploaded, feeding back the path information of the target container mirror image to the web client.
Optionally, the pushing the target container mirror image directly to a target machine in the production environment includes:
and when an image creating request initiated by the web client is received, directly importing the target container image into a target machine in the production environment.
Optionally, the container deployment method further includes:
after the target container mirror image is successfully imported into the target machine, the identification of the target container mirror image is fed back to the web client, so that the web client can initiate the operation aiming at the target container mirror image to the web server aiming at the identification of the target container mirror image.
Optionally, the deploying a target container on the target machine according to the target container image includes:
when a request of the web client for deploying a container on the target machine, which is initiated by the target container image, is received, deploying the target container on the target machine according to the target container image.
Optionally, the container deployment method further includes:
after the target container is successfully deployed on the target machine, feeding back the identification of the target container to the web client, so that the web client can initiate an operation aiming at the target container to the web server aiming at the identification of the target container.
A container deployment method applied to a web client, the method comprising:
obtaining a target container mirror image derived from a container warehouse in a research and development environment;
and uploading the target container mirror image to a web server so that the web server pushes the target container mirror image to a target machine in a production environment, and deploying a target container on the target machine according to the target container mirror image.
Optionally, the container deployment method further includes:
sending a mirror image creating request to the web server so that the web server directly guides the target container mirror image to a target machine in the production environment, wherein a Docker service is deployed on the target machine, and the target machine acquires the target container mirror image through a remote access interface of the Docker service;
initiating a request to deploy a container on the target machine for the target container image to cause the web server to deploy the target container on the target machine according to the target container image.
Optionally, the container deployment method further includes:
receiving the identification of the target container image fed back by the web server so as to initiate an operation aiming at the target container image to the web server based on the identification of the target container image.
Optionally, the container deployment method further includes:
receiving the identification of the target container fed back by the web server so as to initiate an operation aiming at the target container to the web server based on the identification of the target container.
A container deployment apparatus applied to a web server, the apparatus comprising: the system comprises a container mirror image receiving module, a container mirror image pushing module and a container deploying module;
the container mirror image receiving module is used for receiving a target container mirror image uploaded by a web client, wherein the target container mirror image is exported from a container warehouse in a research and development environment;
the container mirror image pushing module is used for pushing the target container mirror image to a target machine in a production environment;
the container deployment module is used for deploying the target container on the target machine according to the target container mirror image.
A container deployment apparatus applied to a web client, the apparatus comprising: the system comprises a container mirror image acquisition module and a container mirror image uploading module;
the container mirror image acquisition module is used for acquiring a target container mirror image derived from a container warehouse in a research and development environment;
the container mirror image uploading module is used for uploading the target container mirror image to a web server so that the web server can push the target container mirror image to a target machine in a production environment, and a target container is deployed on the target machine according to the target container mirror image.
A web server, comprising: a memory and a processor;
the memory is used for storing programs;
the processor is configured to execute the program to implement any of the steps of the container deployment method applied to the web server.
A readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of any of the above-mentioned methods for container deployment applied to the web server.
A container deployment system comprising: a web client and a web server;
the web client is used for acquiring a target container mirror image derived from a container warehouse in a research and development environment and uploading the target container mirror image to a web server;
the web server is used for pushing the target container mirror image to a target machine in a production environment; and deploying a target container on the target machine according to the target container mirror image.
Optionally, a Docker service is deployed on the target machine;
the web server is specifically configured to directly push the target container image to a target machine in the production environment, so that the target machine obtains the target container image through a remote access interface of the Docker service.
According to the scheme, in the container deployment method provided by the application, the web client can obtain the target container mirror image derived from the container warehouse in the research and development environment and upload the obtained target container mirror image to the web server, and after the web server obtains the target container mirror image, the web server can push the target container mirror image to the target machine in the production environment and deploy the target container on the target machine according to the target container mirror image. According to the container deployment method, under the condition that a research and development environment is not communicated with a production environment, a target container mirror image in the research and development environment can be pushed to a target machine in the production environment based on the web client and the web server, and the target container can be deployed on the target machine according to the target container mirror image.
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 schematic flowchart of a container deployment method applied to a web server according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a container deployment method applied to a web client according to an embodiment of the present application;
fig. 3 is a flowchart illustrating a possible implementation manner of implementing container deployment based on a web client and a web server according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating another possible implementation manner of implementing container deployment based on a web client and a web server according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a container deployment apparatus applied to a web server according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a container deployment apparatus applied to a web client according to an embodiment of the present application;
FIG. 7 is a schematic structural diagram of a web server provided in an embodiment of the present application;
fig. 8 is a schematic structural diagram of a container deployment system according to an embodiment of the present application.
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.
The inventor finds that some container deployment schemes exist in the prior art in the process of implementing the invention, but the schemes need to communicate a development environment with a production environment and also need to install a lot of components and services, namely, the existing container deployment schemes are not suitable for a closed local area network environment.
In order to solve the problems that in a closed local area network environment, a research and development environment is not communicated with a production environment, so that a container cannot be pushed to a machine to be deployed in the production environment in a mirror image manner, and the container cannot be deployed on the machine to be deployed, the inventor of the present application has made research:
the initial thinking was: the method comprises the steps of manually exporting a container mirror image from a container warehouse in a development environment, manually importing the container mirror image into a machine to be deployed, and manually deploying a container on the machine to be deployed.
It should be noted that the container warehouse is a place for storing the image files, and the container warehouse can be divided into a public warehouse and a private warehouse according to whether the stored image files are publicly shared or not, the image files stored in the public warehouse are image files that are publicly shared by a plurality of users, the image files in the public warehouse can be downloaded by all users, if a user does not want to publicly share the image files of the user, a private warehouse which can only be accessed by the user can be created, and the image files in the private warehouse can be downloaded only by the user who creates the private warehouse. When the user creates the own mirror image, the mirror image can be uploaded to a public warehouse or a private warehouse.
The inventor finds that, although the above idea can solve the problem that in a closed local area network environment, a container mirror image in a research and development environment cannot be pushed to a machine to be deployed in a production environment, and then a container cannot be deployed on the machine to be deployed, some problems exist, and are specifically embodied in that:
however, in some cases, hundreds or even thousands of machines to be deployed may exist, a large amount of manpower is consumed for manually introducing the container mirror image and manually creating the container, and the container deployment efficiency is low, that is, the labor cost and the time cost of the above-mentioned idea are high, and in addition, the manual operation is greatly influenced by subjective factors, and unexpected errors may be generated.
In view of the problems in the above-mentioned ideas, the inventors of the present invention have continued research and have proposed a container deployment scheme, which has the following general ideas: the method comprises the steps of manually exporting a container mirror image from a container warehouse in a research and development environment, deploying the container warehouse in a production environment, manually importing the container mirror image into the container warehouse deployed in the production environment, manually pulling the container mirror image from the container warehouse deployed in the production environment to a machine to be deployed, and manually deploying a container on the machine to be deployed.
The inventor has found that although the above scheme introduces the use of a container warehouse to manage the mirror image, the container mirror image still needs to be manually pulled to the machine to be deployed and the container still needs to be manually deployed on the machine to be deployed, and the problems that the container deployment needs to consume a large amount of manpower, the container deployment efficiency is low, and unexpected errors may occur during deployment are still not solved.
In view of the above problems, the present inventors have continued intensive research and development to finally provide a solution to perfectly solve the above problems in the development process. The container deployment method provided herein is described next by the following examples.
The container deployment method is realized based on a web client and a web server, and the technical scheme of the method is introduced by standing on one side of the web server.
Referring to fig. 1, a flow diagram of a container deployment method applied to a web server is shown, where the method may include:
step S101: and receiving the target container mirror image uploaded by the web client.
The target container mirror image is a mirror image of a target container to be deployed, and the target container mirror image is derived from a container warehouse in a research and development environment.
In this embodiment, the mirror image of the target container to be deployed may be a tar file, and after the development of the research and development environment is completed, the mirror image of the target container may be made by docker file, and the mirror image of the target container is imported into a container warehouse in the research and development environment.
Step S102: pushing the target container image to a target machine in the production environment.
In one possible implementation manner, after the target container mirror image uploaded by the web client is obtained, the target container mirror image is read to the local, the read target container mirror image is pushed to a container warehouse deployed in the production environment in advance, then the target container mirror image is pulled from the container warehouse deployed in the production environment, and the pulled target container mirror image is pushed to the target machine in the production environment.
In another possible implementation manner, a Docker service may be deployed on a target machine, the Docker service provides a remote access interface Docker web API, and after a target container image uploaded by a web client is obtained, the target container image is directly pushed to the target machine, so that the target machine obtains the target container image pushed by the web server through the remote access interface of the Docker service.
Step S103: deploying the target container on the target machine according to the target container mirror image.
In the container deployment method provided by the embodiment of the application, the web server can receive the target container mirror image uploaded by the web client, and after the target container mirror image is obtained, the target container mirror image can be pushed to a target machine in a production environment, so that the container is deployed on the target machine according to the container mirror image.
Next, the technical solution of the present application is described by standing on the web client side.
Referring to fig. 2, a container deployment method applied to a web client is shown, which may include:
step S201: a target container image derived from a container warehouse in a development environment is obtained.
In this embodiment, a target container image is derived in advance from a container warehouse in a development environment, and when a container needs to be deployed at a target machine in a production environment, the derived target container image is acquired.
Step S202: and uploading the target container mirror image to a web server so that the web server pushes the target container mirror image to a target machine in a production environment, and deploying the target container on the target machine according to the target container mirror image.
Specifically, the web client initiates a container mirror image uploading request to the web server, so that the web server calls an uploading interface, triggers a mirror image uploading operation, and uploads a target container mirror image to the web server.
In the container deployment method provided by the embodiment of the application, the web client can upload the target container mirror image derived from the container warehouse in the development environment to the web server, so that the web server can push the target container mirror image to the target machine in the production environment when obtaining the target container mirror image, and then deploy the container on the target machine according to the container mirror image.
According to the container deployment method provided by the embodiment of the application, under the condition that a research and development environment is not communicated with a production environment, a target container mirror image in the research and development environment can be pushed to a target machine in the production environment based on a web client and a web server, and the target container can be deployed on the target machine according to the target container mirror image. In addition, the container deployment method provided by the embodiment of the application does not need to manually create the container mirror image and the container, so that the labor is greatly saved, the container deployment efficiency is improved, namely, the labor cost and the time cost are reduced, and the container mirror image and the container are not needed to be manually created, so that errors possibly generated by manual operation are avoided.
Based on the above embodiments, the specific process of deploying a container by a target machine in a production environment is described in detail below through information interaction between a web client and a web server.
Referring to fig. 3, a flowchart illustrating a possible implementation manner of implementing container deployment based on a web client and a web server may include:
step S301: a web client obtains a target container image derived from a container repository in a development environment.
In this embodiment, the target container mirror image is derived from a container warehouse in a development environment in advance, and when a target machine in a production environment needs to deploy a target container, the web client acquires the pre-derived target container mirror image.
Step S302: the web client uploads the target container image to the web server.
It should be noted that, the Web server in this embodiment may implement a Web scheduling service, and optionally, the function of the Web server in this embodiment may be implemented based on openreserve, which is a high-performance Web platform based on Nginx and Lua, and because a large number of excellent Lua libraries, third-party modules, and most of dependence items are integrated inside the Web server, a dynamic Web application, a Web service, and a dynamic gateway capable of handling ultrahigh concurrency and extremely high extensibility may be conveniently built.
Step S303: and after the target container mirror image is successfully uploaded, the web server feeds back indication information of the successful uploading of the target container mirror image to the web client.
Step S304: and the web server reads the target container image uploaded by the web client to the local.
Specifically, the web server may execute a Docker load command, and read a target container image uploaded by the web client to the local.
Step S305: and the web server pushes the target container image read to the local to a container warehouse which is deployed in the production environment in advance.
Specifically, the web server may execute a Docker push command, and push the target container mirror image to a container warehouse deployed in the production environment in advance.
Step S306: the web server pulls the target container image from a container store deployed in the production environment.
Step S307: the web server pushes the pulled target container image to a target machine in the production environment.
Specifically, the web server may call a POST/images/create interface to push the target container image to the target machine.
Step S308: after the target container mirror image is successfully pushed to the target machine, the web server feeds back indication information of successful creation of the target container mirror image to the web client.
Step S309: the web server deploys the target container at the target machine according to the target container image.
Step S310: and after the target machine successfully deploys the target container, the web server feeds back indication information of successful creation of the target container to the web client.
According to the container deployment method provided by the embodiment of the application, the container mirror image in the research and development environment can be pushed to the target machine in the production environment based on the web client and the web server, and the container can be deployed on the target machine according to the container mirror image. The container deployment method provided by the embodiment of the application is not only suitable for a closed local area network environment, but also low in artificial participation degree and high in container deployment efficiency.
It should be noted that, the above scheme for implementing container deployment needs to deploy a container warehouse in a production environment, which results in a relatively complicated process for implementing container deployment, and the step S304 and the step S305 execute a Docker command without detailed return results, and therefore, whether the execution is successful or not cannot be known.
Referring to fig. 4, a flow diagram illustrating another possible implementation of implementing container deployment based on a web client and a web server is shown, which may include:
step S401: a web client obtains a target container image derived from a container repository in a development environment.
In this embodiment, the target container mirror image is derived from a container warehouse in a development environment in advance, and when a target machine in a production environment needs to deploy a target container, the web client acquires the pre-derived target container mirror image.
Step S402: the web client uploads the target container image to the web server.
Specifically, the web client initiates a container mirror image uploading request to the web server, so that the web server calls an uploading interface (i.e., upload interface), triggers a mirror image uploading operation, and uploads a target container mirror image to the web server.
Step S403: and the web server feeds back the uploading progress of the target container mirror image to the web client in the uploading process of the target container mirror image.
Optionally, the web server may feed back, to the web client, indication information for indicating a current uploading progress when uploading the preset proportion of the target container image, for example, when 10% of the target container image is uploaded, the indication information that 10% of the target container image is uploaded is fed back to the web client, when 20% of the target container image is uploaded, the indication information that 20% of the target container image is uploaded is fed back to the web client, and so on.
Step S404: and after the target container mirror image is successfully uploaded, the web server feeds back the path information of the target container mirror image to the web client.
Typically, the web client receives path information of the target container image, i.e. indicating that the target container image was successfully uploaded.
Optionally, after the target container image is successfully uploaded, the web server may also feed back indication information that the target container image is successfully uploaded and path information of the target container image to the web client.
Step S405: the web client sends an image creation request to the web server.
After the target container mirror image is uploaded successfully, the web client can select the target container mirror image and initiate a mirror image creation request to the web server aiming at the target container mirror image.
Step S406: the web server imports the target container image to a target machine in the production environment after receiving the image creation request.
The target machine is deployed with a Docker service, and acquires the target container image through a Remote access interface (i.e., Docker Remote API) of the Docker service.
It should be noted that, in this embodiment, a Docker service needs to be installed on the target machine, and a Docker Remote access service (i.e., a Docker Remote API) is started at the same time.
Different installation modes are selected according to different platforms in the Docker service installation requirement. The Docker service native supports Remote API, can realize Remote calling, but defaults to a closed state, needs to modify a configuration file to start the service, edits the following file of Docker deployment Linux system,/lib/system/Docker. ExecStart ═ usr/bin/dockerd-H tcp:// 0.0.0:4243-H unix:// var/run/Docker. socket, systemctl daemon-load is executed, and then the Docker service is restarted, i.e., the Docker Remote API is turned on. In this embodiment, the Docker Remote API version is 1.36, but this embodiment is not limited thereto, and a version before 1.36 or a version after 1.36 may also be used.
In this embodiment, the web server may invoke a POST/images/load interface, import the target container image to the target machine, and complete the image creation.
Step S407: and after the target container mirror image is successfully imported into the target machine, the web server feeds back the identification of the target container mirror image to the web client.
Optionally, the web server may also feed back indication information of successful creation of the target container image and an identifier of the target container image.
It should be noted that the purpose of the web server feeding back the identifier of the target container image to the web client is to facilitate the web client initiating an operation on the target container image to the web server according to the identifier of the target container image.
Wherein the operations for mirroring the target container may be, but are not limited to, viewing, modifying, deleting, and the like.
Step S408: the web client sends a container creation request for the target machine to the web server.
After the web server successfully imports the target container mirror image into the target machine, the web client can select the target machine and initiate a request for creating the target container on the target machine aiming at the target container mirror image.
Step S409: the web server deploys the container on the target machine according to the target container image after receiving the container creation request for the target machine.
Specifically, the web server may invoke a POST/contacts/create interface to deploy the target container to the target machine.
Step S410: and after the target container is successfully deployed on the target machine, the web server feeds back the identification of the target container to the web client.
Optionally, the web server may also feed back, to the web client, information indicating that the target container was successfully deployed and an identifier of the target container.
It should be noted that the purpose of the web server feeding back the identification of the target container to the web client is to facilitate the web client initiating an operation on the target container to the web server according to the identification of the target container.
Wherein, the operation on the target container can be but is not limited to viewing, starting, stopping, restarting, deleting, etc.
According to the container deployment method provided by the embodiment of the application, the container mirror image in the research and development environment can be pushed to the target machine in the production environment based on the web client and the web server only by deploying the Docker service on the machine to be deployed, and the container can be deployed on the target machine according to the container mirror image. The container deployment method provided by the embodiment of the application is not only suitable for a closed local area network environment, but also does not need to deploy a container warehouse, the implementation process is simple, the manual participation degree is low, and the container deployment efficiency is high.
Corresponding to the above container deployment method applied to the web server, an embodiment of the present application further provides a container deployment apparatus applied to the web server, please refer to fig. 5, which shows a schematic structural diagram of the container deployment apparatus applied to the web server, and the schematic structural diagram may include: a container image receiving module 501, a container image pushing module 502 and a container deployment module 503.
And a container image receiving module 501, configured to receive a target container image uploaded by the web client.
Wherein the target container image is derived from a container warehouse in a development environment;
a container image pushing module 502 for pushing the target container image to a target machine in a production environment.
A container deployment module 503, configured to deploy a target container on the target machine according to the target container image.
The container deployment device provided by the embodiment of the application enables a web server to receive a target container mirror image uploaded by a web client, and after the target container mirror image is obtained, the target container mirror image can be pushed to a target machine in a production environment, so that a container is deployed on the target machine according to the container mirror image. The container deployment device provided by the embodiment of the application can realize that the container mirror image in the research and development environment is pushed to the target machine in the production environment under the condition that the research and development environment is different from the production environment, the container can be deployed on the target machine according to the container mirror image, the implementation process is simple, the manual participation degree is low, and the container deployment efficiency is high.
Optionally, if a Docker service is deployed on the target machine, in the container deployment apparatus applied to the web server provided in the foregoing embodiment, the container image pushing module 502 is specifically configured to directly push the target container image to the target machine in the production environment, so that the target machine obtains the target container image through a remote access interface of the Docker service.
Optionally, in the container deployment apparatus applied to the web server provided in the foregoing embodiment, the container image pushing module 502 may include: the device comprises a container mirror image reading sub-module, a first container mirror image pushing sub-module, a container mirror image pulling sub-module and a second container mirror image pushing sub-module. The pushing the target container image to a target machine in a production environment, comprising:
and the container mirror image reading submodule is used for reading the target container mirror image to the local.
And the first container mirror image pushing submodule is used for pushing the target container mirror image read to the local to a container warehouse which is deployed in the production environment in advance.
And the container mirror image pulling submodule is used for pulling the target container mirror image from a container warehouse deployed in the production environment.
And the second container mirror image pushing submodule is used for pushing the pulled target container mirror image to a target machine in the production environment.
Optionally, in the container deployment apparatus applied to the web server provided in the foregoing embodiment, the container image receiving module 501 may include: a mirror image uploading request receiving submodule and a container mirror image receiving submodule.
And the mirror image uploading request receiving submodule is used for receiving a container mirror image uploading request initiated by the web client.
And the container mirror image receiving submodule is used for calling an uploading interface and receiving the target container mirror image uploaded by the web client when the mirror image uploading request receiving submodule receives the container mirror image uploading request initiated by the web client.
Optionally, the container deployment apparatus applied to the web server provided in the foregoing embodiment further includes: an uploading progress feedback module and a path information feedback module.
And the uploading progress feedback module is used for feeding back the uploading progress of the target container mirror image to the web client in the uploading process of the target container mirror image.
And the path information feedback module is used for feeding back the path information of the target container mirror image to the web client when the target container mirror image is uploaded.
Optionally, in the container deployment apparatus applied to the web server provided in the foregoing embodiment, the container image pushing module 502 includes: the mirror creation request receiving submodule and the container mirror importing submodule.
And the image creation request receiving submodule is used for receiving an image creation request initiated by the web client.
And the container mirror image importing submodule is used for directly importing the target container mirror image into the target machine in the production environment when the mirror image creation request receiving submodule receives the mirror image creation request initiated by the web client.
Optionally, the container deployment apparatus applied to the web server provided in the foregoing embodiment further includes: the container mirror identifies the feedback module.
And the container mirror image identification feedback module is used for feeding back the identification of the target container mirror image to the web client after the target container mirror image is successfully imported into the target machine, so that the web client can initiate the operation aiming at the target container mirror image to the web server aiming at the identification of the target container mirror image.
Optionally, in the container deployment apparatus applied to the web server provided in the foregoing embodiment, the container deployment module 503 may include: the system comprises a container deployment request receiving submodule and a container deployment submodule.
And the container deployment request receiving submodule is used for receiving a request of the web client for deploying the container on the target machine, wherein the request is initiated by the web client aiming at the target container image.
And the container deployment sub-module is used for deploying the target container on the target machine according to the target container mirror image when the container deployment request receiving sub-module receives a request of deploying the container on the target machine, which is initiated by the web client aiming at the target container mirror image.
Optionally, the container deployment apparatus applied to the web server provided in the foregoing embodiment further includes: a container identification feedback module.
And the container identification feedback module is used for feeding back the identification of the target container to the web client after the target container is successfully deployed on the target machine, so that the web client can initiate the operation aiming at the target container to the web server aiming at the identification of the target container.
An embodiment of the present application further provides a container deployment apparatus applied to a client, please refer to fig. 6, which shows a schematic structural diagram of the container deployment apparatus applied to the client, and the schematic structural diagram may include: a container image acquisition module 601 and a container image upload module 602.
A container mirror image obtaining module 601, configured to obtain a target container mirror image derived from a container warehouse in a development environment;
a container mirror image uploading module 602, configured to upload the target container mirror image to a web server, so that the web server pushes the target container mirror image to a target machine in a production environment, and deploy a target container on the target machine according to the target container mirror image.
According to the container deployment device provided by the embodiment of the application, the web client can upload the target container mirror image derived from the container warehouse in the research and development environment to the web server, so that the web server can push the target container mirror image to the target machine in the production environment when obtaining the target container mirror image, and then deploy the container on the target machine according to the container mirror image.
Optionally, the container deployment apparatus applied to the web client provided in the foregoing embodiment further includes: the system comprises a mirror image creation request sending module and a container deployment request sending module.
And the image creation request sending module is used for sending an image creation request to the web server so that the web server directly imports the target container image into a target machine in the production environment.
A container deployment request sending module, configured to initiate a request for deploying a container on the target machine for the target container image, so that the web server deploys the target container on the target machine according to the target container image.
Optionally, the container deployment apparatus applied to the web client provided in the foregoing embodiment further includes: the container image identifies the receiving module.
A container image identification receiving module, configured to receive the identification of the target container image fed back by the web server, so as to initiate an operation for the target container image to the web server based on the identification of the target container image.
Optionally, the container deployment apparatus applied to the web client provided in the foregoing embodiment further includes: a container identification receiving module.
A container identification receiving module, configured to receive the identification of the target container fed back by the web server, so as to be able to initiate an operation for the target container to the web server based on the identification of the target container.
An embodiment of the present application further provides a web server, please refer to fig. 7, which shows a schematic structural diagram of the web server, where the web server may include: at least one processor 701, at least one communication interface 702, at least one memory 703 and at least one communication bus 704;
in the embodiment of the present application, the number of the processor 701, the communication interface 702, the memory 703 and the communication bus 704 is at least one, and the processor 701, the communication interface 702 and the memory 703 complete mutual communication through the communication bus 704;
the processor 701 may be a central processing unit CPU, or an application specific Integrated circuit asic, or one or more Integrated circuits configured to implement embodiments of the present invention, or the like;
the memory 703 may include a high-speed RAM memory, and may further include a non-volatile memory (non-volatile memory) or the like, such as at least one disk memory;
wherein the memory stores a program and the processor can call the program stored in the memory, the program for:
receiving a target container mirror image uploaded by a web client, wherein the target container mirror image is exported from a container warehouse in a development environment;
pushing the target container mirror image to a target machine in a production environment;
deploying a target container on the target machine according to the target container image.
Alternatively, the detailed function and the extended function of the program may be as described above.
Embodiments of the present application further provide a readable storage medium, where a program suitable for being executed by a processor may be stored, where the program is configured to:
receiving a target container mirror image uploaded by a web client, wherein the target container mirror image is exported from a container warehouse in a development environment;
pushing the target container mirror image to a target machine in a production environment;
deploying a target container on the target machine according to the target container image.
An embodiment of the present application further provides a container deployment system, please refer to fig. 8, which shows a schematic structural diagram of the container deployment system, and the system may include: a web client 801 and a web server 802.
A web client 801, configured to obtain a target container image derived from a container warehouse in a development environment, and upload the target container image to a web server;
a web server 802 for pushing the target container image to a target machine in the production environment; and deploying the target container on the target machine according to the target container mirror image.
The container deployment system provided by the embodiment of the application can push the container mirror image in the research and development environment to the target machine in the production environment based on the web client and the web server under the condition that the research and development environment is not communicated with the production environment, and can deploy the container on the target machine according to the container mirror image, namely, the container deployment method provided by the application is suitable for a closed local area network environment, and is simple in implementation process, low in manual participation degree and high in container deployment efficiency.
Optionally, if a Docker service is deployed on the target machine, the web server 802 in the container deployment system provided in the foregoing embodiment is specifically configured to directly push the target container image to the target machine in the production environment, so that the target machine obtains the target container image through a remote access interface of the Docker service.
Optionally, the web server 802 in the container deployment system provided in the foregoing embodiment is specifically configured to push the read local target container image to a container warehouse that is deployed in a production environment in advance; the target container image is pulled from a container warehouse deployed in the production environment and pushed to a target machine in the production environment.
Optionally, the web client 801 is further configured to initiate a container image upload request to the web server 802; the web server 802 is configured to, when receiving a container image upload request initiated by the web client 801, invoke an upload interface, and receive a target container image uploaded by the web client 801.
Optionally, the web server 802 is further configured to feed back an uploading progress of the target container image to the web client 801 in the process of uploading the target container image; when the target container image is uploaded, the path information of the target container image is fed back to the web client 801.
Optionally, the web client 801 is further configured to initiate an image creation request to the web server 802; the web server 802 is configured to directly import the target container image to the target machine in the production environment upon receiving the image creation request initiated by the web client 801.
Optionally, the web server 802 is further configured to feed back, after the target container image is successfully imported into the target machine, an identifier of the target container image to the web client 801, so that the web client 801 can initiate an operation on the target container image to the web server according to the identifier of the target container image.
Optionally, the web client 801 is further configured to initiate a container deployment request to the web server 802, where the container deployment request is used to request that a container is deployed on a target machine for a target container image; and the web server 802 is used for deploying the target container on the target machine according to the target container image when the container deployment request is received.
Optionally, the web server 802 is further configured to feed back the identifier of the target container to the web client 801 after the target container is successfully deployed on the target machine, so that the web client 801 can initiate an operation on the target container to the web server 802 according to the identifier of the target container.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, 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 described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to 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 (19)

1. A container deployment method applied to a web server, the method comprising:
receiving a target container mirror image uploaded by a web client, wherein the target container mirror image is exported from a container warehouse in a development environment;
pushing the target container mirror image to a target machine in a production environment;
deploying a target container on the target machine according to the target container image.
2. The container deployment method of claim 1, wherein a Docker service is deployed on the target machine;
the pushing the target container image to a target machine in a production environment, comprising:
and directly pushing the target container mirror image to a target machine in the production environment, so that the target machine acquires the target container mirror image through a remote access interface of the Docker service.
3. The container deployment method of claim 1, wherein the pushing the target container image to a target machine in a production environment comprises:
reading the mirror image of the target container to the local;
pushing the target container mirror image read to the local to a container warehouse which is deployed in the production environment in advance;
and pulling the target container mirror image from a container warehouse deployed in the production environment, and pushing the pulled target container mirror image to a target machine in the production environment.
4. The container deployment method according to claim 2, wherein the receiving the container image uploaded by the web client comprises:
and when a container mirror image uploading request initiated by the web client is received, calling an uploading interface, and receiving the target container mirror image uploaded by the web client.
5. The vessel deployment method of claim 4, further comprising:
in the process of uploading the target container mirror image, feeding back the uploading progress of the target container mirror image to the web client;
and when the target container mirror image is uploaded, feeding back the path information of the target container mirror image to the web client.
6. The container deployment method of claim 2, wherein the pushing the target container image directly to a target machine in the production environment comprises:
and when an image creating request initiated by the web client is received, directly importing the target container image into a target machine in the production environment.
7. The vessel deployment method of claim 6, further comprising:
after the target container mirror image is successfully imported into the target machine, the identification of the target container mirror image is fed back to the web client, so that the web client can initiate the operation aiming at the target container mirror image to the web server aiming at the identification of the target container mirror image.
8. The container deployment method of claim 2, wherein said deploying a target container on the target machine according to the target container image comprises:
when a request of the web client for deploying a container on the target machine, which is initiated by the target container image, is received, deploying the target container on the target machine according to the target container image.
9. The vessel deployment method of claim 8, further comprising:
after the target container is successfully deployed on the target machine, feeding back the identification of the target container to the web client, so that the web client can initiate an operation aiming at the target container to the web server aiming at the identification of the target container.
10. A container deployment method applied to a web client, the method comprising:
obtaining a target container mirror image derived from a container warehouse in a research and development environment;
and uploading the target container mirror image to a web server so that the web server pushes the target container mirror image to a target machine in a production environment, and deploying a target container on the target machine according to the target container mirror image.
11. The vessel deployment method of claim 10, further comprising:
sending a mirror image creating request to the web server so that the web server directly guides the target container mirror image to a target machine in the production environment, wherein a Docker service is deployed on the target machine, and the target machine acquires the target container mirror image through a remote access interface of the Docker service;
initiating a request to deploy a container on the target machine for the target container image to cause the web server to deploy the target container on the target machine according to the target container image.
12. The vessel deployment method of claim 11, further comprising:
receiving the identification of the target container image fed back by the web server so as to initiate an operation aiming at the target container image to the web server based on the identification of the target container image.
13. The vessel deployment method of claim 11, further comprising:
receiving the identification of the target container fed back by the web server so as to initiate an operation aiming at the target container to the web server based on the identification of the target container.
14. A container deployment apparatus, applied to a web server, the apparatus comprising: the system comprises a container mirror image receiving module, a container mirror image pushing module and a container deploying module;
the container mirror image receiving module is used for receiving a target container mirror image uploaded by a web client, wherein the target container mirror image is exported from a container warehouse in a research and development environment;
the container mirror image pushing module is used for pushing the target container mirror image to a target machine in a production environment;
the container deployment module is used for deploying the target container on the target machine according to the target container mirror image.
15. A container deployment apparatus, applied to a web client, the apparatus comprising: the system comprises a container mirror image acquisition module and a container mirror image uploading module;
the container mirror image acquisition module is used for acquiring a target container mirror image derived from a container warehouse in a research and development environment;
the container mirror image uploading module is used for uploading the target container mirror image to a web server so that the web server can push the target container mirror image to a target machine in a production environment, and a target container is deployed on the target machine according to the target container mirror image.
16. A web server, comprising: a memory and a processor;
the memory is used for storing programs;
the processor, configured to execute the program, to implement the steps of the container deployment method according to any one of claims 1 to 9.
17. A readable storage medium having stored thereon a computer program for implementing the steps of the container deployment method according to any one of claims 1 to 9 when executed by a processor.
18. A container deployment system, comprising: a web client and a web server;
the web client is used for acquiring a target container mirror image derived from a container warehouse in a research and development environment and uploading the target container mirror image to a web server;
the web server is used for pushing the target container mirror image to a target machine in a production environment; and deploying a target container on the target machine according to the target container mirror image.
19. The container deployment system of claim 18, wherein a Docker service is deployed on the target machine;
the web server is specifically configured to directly push the target container image to a target machine in the production environment, so that the target machine obtains the target container image through a remote access interface of the Docker service.
CN201910987477.6A 2019-10-17 2019-10-17 Container deployment method, device, equipment, storage medium and container deployment system Active CN110727503B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910987477.6A CN110727503B (en) 2019-10-17 2019-10-17 Container deployment method, device, equipment, storage medium and container deployment system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910987477.6A CN110727503B (en) 2019-10-17 2019-10-17 Container deployment method, device, equipment, storage medium and container deployment system

Publications (2)

Publication Number Publication Date
CN110727503A true CN110727503A (en) 2020-01-24
CN110727503B CN110727503B (en) 2021-04-20

Family

ID=69220155

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910987477.6A Active CN110727503B (en) 2019-10-17 2019-10-17 Container deployment method, device, equipment, storage medium and container deployment system

Country Status (1)

Country Link
CN (1) CN110727503B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112084006A (en) * 2020-09-10 2020-12-15 杭州海康威视系统技术有限公司 Mirror image packet processing method and device and electronic equipment
CN113238831A (en) * 2021-04-30 2021-08-10 中核武汉核电运行技术股份有限公司 Nuclear power production service loading method and device based on container technology
CN113434254A (en) * 2021-06-30 2021-09-24 深圳平安智汇企业信息管理有限公司 Client deployment method, client deployment apparatus, computer device, and storage medium
CN114090183A (en) * 2021-11-25 2022-02-25 北京字节跳动网络技术有限公司 Application starting method and device, computer equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170085419A1 (en) * 2015-09-18 2017-03-23 Le Holdings (Beijing) Co., Ltd. System and method for deploying an application
CN107908535A (en) * 2017-11-13 2018-04-13 珠海金山网络游戏科技有限公司 Distributed clients analogy method and device
CN108205481A (en) * 2016-12-19 2018-06-26 华为技术有限公司 The container instance creation method and device of application
CN109683909A (en) * 2018-11-30 2019-04-26 昆明理工大学 A kind of MPI parallel environment automatic deployment method based on Docker

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170085419A1 (en) * 2015-09-18 2017-03-23 Le Holdings (Beijing) Co., Ltd. System and method for deploying an application
CN108205481A (en) * 2016-12-19 2018-06-26 华为技术有限公司 The container instance creation method and device of application
CN107908535A (en) * 2017-11-13 2018-04-13 珠海金山网络游戏科技有限公司 Distributed clients analogy method and device
CN109683909A (en) * 2018-11-30 2019-04-26 昆明理工大学 A kind of MPI parallel environment automatic deployment method based on Docker

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112084006A (en) * 2020-09-10 2020-12-15 杭州海康威视系统技术有限公司 Mirror image packet processing method and device and electronic equipment
CN112084006B (en) * 2020-09-10 2024-02-02 杭州海康威视系统技术有限公司 Mirror image package processing method and device and electronic equipment
CN113238831A (en) * 2021-04-30 2021-08-10 中核武汉核电运行技术股份有限公司 Nuclear power production service loading method and device based on container technology
CN113434254A (en) * 2021-06-30 2021-09-24 深圳平安智汇企业信息管理有限公司 Client deployment method, client deployment apparatus, computer device, and storage medium
CN113434254B (en) * 2021-06-30 2023-03-07 深圳平安智汇企业信息管理有限公司 Client deployment method, client deployment apparatus, computer device, and storage medium
CN114090183A (en) * 2021-11-25 2022-02-25 北京字节跳动网络技术有限公司 Application starting method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN110727503B (en) 2021-04-20

Similar Documents

Publication Publication Date Title
CN110727503B (en) Container deployment method, device, equipment, storage medium and container deployment system
CN110752947A (en) K8s cluster deployment method and device, and deployment platform
CN108519874B (en) Python project package generation method and device
CN113296792B (en) Storage method, device, equipment, storage medium and system
CN111026414B (en) HDP platform deployment method based on kubernetes
CN110968331B (en) Method and device for running application program
CN115328529B (en) Application management method and related equipment
CN112615747A (en) Method and device for automatically deploying and configuring network equipment
CN110275719B (en) Cloud physical host operating system deployment method based on domestic CPU and operating system
CN114546588A (en) Task deployment method and device, storage medium and electronic device
CN114443226A (en) IDE application on-cloud deployment method and system based on kubernets
CN112379934B (en) Deployment method and device of cloud computing platform and storage medium
US20230289165A1 (en) Data processing method and apparatus for application, device, and storage medium
CN111610980A (en) Deployment system and method
CN114756261B (en) Container cluster upgrading method and system, electronic equipment and medium
CN114217908B (en) Container starting method, system, device and equipment
CN115883348A (en) Cobbler-based automatic deployment method, device and medium for all-in-one machine
CN113419814B (en) Virtual machine creating method, device, equipment and storage medium in cloud platform
CN115225628A (en) Preheating type mirror image loading method based on lightweight container cloud environment
CN115344644A (en) Data synchronization method and device, electronic equipment and computer readable storage medium
CN115437647A (en) Multi-frame-adaptive micro-service deployment method, device, terminal and storage medium
CN111026502B (en) Business debugging architecture creating method and device, electronic equipment and storage medium
CN113010206A (en) Containerization method, system and device for WEB application system
CN114327667B (en) Dynamic resource loading method and system
CN112363717B (en) Method and terminal for loading different functions in single software

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