CN110688137A - Application delivery method and device and storage medium - Google Patents
Application delivery method and device and storage medium Download PDFInfo
- Publication number
- CN110688137A CN110688137A CN201910925958.4A CN201910925958A CN110688137A CN 110688137 A CN110688137 A CN 110688137A CN 201910925958 A CN201910925958 A CN 201910925958A CN 110688137 A CN110688137 A CN 110688137A
- Authority
- CN
- China
- Prior art keywords
- docker
- mirror image
- variable
- target application
- custom
- 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
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
An embodiment of the specification provides an application delivery method, an application delivery device and a storage medium, wherein the method comprises the following steps: constructing a Docker mirror image capable of being operated and maintained based on the target application; starting a Docker mirror image capable of being operated and maintained to obtain a Docker container; obtaining a user-defined variable, wherein the user-defined variable is a variable related to a target site, and the target site is a site deployed by a target application; updating the settings of the Docker container based on the custom variables; the Docker vessel is started. The technical scheme provided by the embodiment of the specification can improve the application delivery efficiency.
Description
Technical Field
The present disclosure relates to the field of computers, and in particular, to an application delivery method and apparatus, and a storage medium.
Background
Since the configuration items of the application are written down, the application needs to be redeveloped when deployed to a new site, which reduces the efficiency of application delivery. For example, company a develops an application for big data, and sells the application to company B, which needs to be delivered on the platform of company B. However, since the environment of the platform of company B is different from that of the platform of company a, which develops the application, a failure occurs in the process of delivering the application, and even the application needs to be newly developed, which reduces the efficiency of delivering the application to company B.
Disclosure of Invention
In view of this, embodiments of the present disclosure provide an application delivery method and apparatus, and a storage medium, so as to improve efficiency of application delivery.
In a first aspect, an embodiment of the present specification provides an application delivery method, where the method includes: constructing a Docker mirror image capable of being operated and maintained based on the target application; starting the Docker mirror image capable of being operated and maintained to obtain a Docker container; obtaining a custom variable, wherein the custom variable is a variable related to a target site, and the target site is a site deployed by the target application; updating the settings of the Docker container based on the custom variables; the Docker vessel is started.
Further, the building of the operational and maintainable Docker image based on the target application includes: acquiring an operation and maintenance script of the target application, a compiling result packet of the target application and a basic Docker mirror image; and constructing the Docker mirror image capable of being operated and maintained based on the operation and maintenance script, the compiling result packet and the basic Docker mirror image.
Further, the constructing the operational and maintainable Docker image based on the operation and maintenance script, the compilation result packet, and the base Docker image includes: writing the address of the basic Docker mirror image, the storage address of the compiling result packet and the storage address of the operation and maintenance script into a Docker File file; and constructing the Docker mirror image of the operable dimension based on the Docker File.
Further, obtaining a compilation result package of the target application includes: acquiring a source code of the target application; extracting variables from the source code; and compiling the source code after the variable is extracted to obtain a compiling result packet of the target application.
Further, the custom variables include at least one of: the database address of the target site, the cache address of the target site and the user login address of the target site.
Further, the updating the settings of the Docker container based on the custom variable includes: inputting the custom variable into the Docker container; updating the compilation result package in the Docker container based on the custom variable.
Further, the updating the compilation result package in the Docker container based on the custom variable includes: and writing the custom variable into the compiling result packet.
In a second aspect, an embodiment of the present specification provides an application delivery apparatus, including: the building unit is used for building a Docker mirror image capable of being operated and maintained based on the target application; the first starting unit is used for starting the Docker mirror image capable of being operated and maintained to obtain a Docker container; the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a custom variable, the custom variable is a variable related to a target site, and the target site is a site deployed by a target application; the updating unit is used for updating the settings of the Docker container based on the user-defined variables; a second starting unit for starting the Docker container.
Further, the construction unit includes: the obtaining subunit is used for obtaining the operation and maintenance script of the target application, the compiling result packet of the target application and a basic Docker mirror image; and the building subunit is used for building the Docker mirror image capable of being operated and maintained based on the operation and maintenance script, the compiling result packet and the basic Docker mirror image.
Further, the building subunit includes: the writing module is used for writing the address of the basic Docker mirror image, the storage address of the compiling result packet and the storage address of the operation and maintenance script into a Docker File file; and the construction module is used for constructing the Docker mirror image of the operable and maintainable system based on the Docker File file.
Further, the acquiring subunit includes: the acquisition module is used for acquiring a source code of the target application; the extraction module is used for extracting the variables in the source codes; and the compiling module is used for compiling the source code after the variables are extracted to obtain a compiling result packet of the target application.
Further, the custom variables include at least one of: the database address of the target site, the cache address of the target site and the user login address of the target site.
Further, the update unit includes: the input subunit is used for inputting the user-defined variable into the Docker container; and the updating subunit is used for updating the compiling result packet in the Docker container based on the custom variable.
Further, the update subunit includes: and the writing module is used for writing the custom variable into the compiling result packet.
In a third aspect, an embodiment of the present specification provides a storage medium, where the storage medium includes a stored program, and when the program runs, a device in which the storage medium is located is controlled to execute the application delivery method according to the first aspect.
In the embodiment of the specification, a Docker mirror image capable of operation and maintenance is constructed based on target application; starting a Docker mirror image capable of being operated and maintained to obtain a Docker container; obtaining a user-defined variable, wherein the user-defined variable is a variable related to a target site, and the target site is a site deployed by a target application; updating the settings of the Docker container based on the custom variables; the Docker container is started to complete delivery of the target application, and the environment required by the application is packaged integrally, so that a user does not need to pay attention to the environment and configuration of the bottom layer of the operating system, and redevelopment is not needed when the application is delivered, and therefore the technical scheme provided by the embodiment of the specification can improve the efficiency of application delivery.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present disclosure, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
FIG. 1 is a schematic diagram of a mirror image construction process provided by an embodiment of the present specification;
FIG. 2 is a schematic diagram of an application delivery process provided by an embodiment of the present specification;
FIG. 3 is a flowchart of an application delivery method provided by an embodiment of the present specification;
fig. 4 is a schematic diagram of an application delivery apparatus provided in an embodiment of the present specification.
Detailed Description
For better understanding of the technical solutions in the present specification, the following detailed description of the embodiments of the present specification is provided with reference to the accompanying drawings.
It should be understood that the described embodiments are only a few embodiments of the present specification, and not all embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments in the present specification without any inventive step are within the scope of the present specification.
The terminology used in the embodiments of the specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the specification. As used in the specification examples and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
Before specifically describing the scheme provided by the embodiments of the present specification, technical terms related to the embodiments of the present specification are explained.
A container: a container is a collection of interfaces between components and a platform in an application server. The container is produced along with the development of the thin client system. In developing a thin client system, a developer expends a great deal of effort to pay attention to thread security, matters, networks, resources, and so on, thereby reducing development efficiency. Since the solutions to these details are generally fixed or only parameters are changed, from the viewpoint of code reuse and design patterns, developers extract these bottom-level details, build platforms, and provide certain interfaces. Thus, the business developer need not be concerned with the implementation of these underlying details, but rather, focus on the implementation of the business logic. The container is typically located within the application server, which is responsible for loading and maintenance. One container can only exist within one application server, and one application server can establish and maintain multiple containers. The containers generally comply with the configurable principle that the user of the container can achieve its own usage requirements by configuring the parameters of the container without modifying the code of the container.
Docker: docker is an open source application container engine, open source based on the Go language and compliant with the Apache2.0 protocol. Docker can let developers package their applications and dependencies into a lightweight, portable container and then distribute them to any popular Linux machine, and can also implement virtualization.
The flow of the application delivery method provided by the embodiment of the present specification mainly includes two parts: a mirror building process and an application delivery process.
Referring to fig. 1, a schematic diagram of a mirror image building process provided in an embodiment of the present disclosure is shown, where the mirror image building process includes: for a software source code of a target application, the content of a dynamic part is extracted as a variable (for example, as a specific implementation, a placeholder may be used to replace the content of the dynamic part), and the source code after the variable extraction is compiled to obtain a compilation result package, for example, the source code may be compiled into a war package or a jar package. And compiling an operation and maintenance script, and inputting the operation and maintenance script, a compiling result packet and a basic Docker mirror image into the Docker mirror image, wherein a CMD (command to be described in detail later) instruction of the mirror image takes the operation and maintenance script as an inlet. Thus, a Docker mirror image capable of fast delivery is designed.
Referring to fig. 2, a schematic diagram of an application delivery process provided in an embodiment of the present disclosure is shown, where the application delivery process includes: variables of a target site (a site to be deployed by a target application), such as a database address of the target site, a cache address of the target site, a user login address of the target site, and the like, are collected, a container can obtain the variables through an ENV instruction, a variable analysis script (which is a part of the operation and maintenance script) in the container analyzes the variables, and placeholders in a compiling result packet are replaced by the analyzed contents. And starting the container to finish application delivery.
Referring to fig. 3, an application delivery method provided in an embodiment of the present disclosure includes: step S301 to step S305.
Step S301: and constructing a Docker mirror capable of being operated and maintained based on the target application.
Step S301 may specifically include: step S3011 and step S3012.
Step S3011: and acquiring the operation and maintenance script of the target application, the compiling result packet of the target application and the basic Docker mirror image.
The obtaining of the compiling result package of the target application specifically includes: acquiring a source code of a target application; extracting variables from the source code; and compiling the source code after the variables are extracted to obtain a compiling result packet of the target application.
After extracting the variables of the source code of the target application, the source code of the target application can be compiled by using a construction tool to obtain a compilation result package of the target application.
The building tools may be Ant, Maven, Gradle, etc.
Step S3012: and constructing a Docker mirror image capable of being operated and maintained based on the operation and maintenance script, the compiling result packet and the basic Docker mirror image.
Constructing a Docker mirror image capable of being operated and maintained based on the operation and maintenance script, the compiling result packet and the basic Docker mirror image, and specifically comprising the following steps: writing the address of the basic Docker mirror image, the storage address of the compiling result packet and the storage address of the operation and maintenance script into a Docker File; and constructing a Docker mirror image of the operable and maintainable system based on the Docker File.
DockerFile is a text formatted configuration file that a user can use to create a custom image.
In the Docker application, the program is run by downloading the mirror image, starting the container and inputting commands into the container, which are all manually input in one piece, cannot be reused and have low efficiency. Therefore, a file or a script is needed, an operation to be executed is written into the file or the script in a command mode, and then the Docker reads, analyzes and executes the operation, so that repeated construction and updating become convenient, and the Docker File is born. Docker provides DockerFile as a script for constructing Docker mirror images, and avoids the input of users line by line. Docker File is described in detail below.
DockerFile is a script interpreted by a Docker program and consists of one instruction, and each instruction corresponds to one command under Linux. The Docker program translates these DockerFile instructions into real Linux commands. DockerFile has its own written format and supported commands, and the Docker program resolves dependencies among these commands. The Docker program will read DockerFile and generate a customized image according to the instruction. With the Docker File, when additional requirements need to be customized, only instructions need to be added or modified on the Docker File, and the mirror image is generated again.
DockerFile is divided into four parts: basic mirror image information, mirror image creator information, mirror image operation instructions and container starting execution instructions. Initially, the name of the image on which it is based is specified, and image creator information is generally described next. Followed by a mirror operation instruction.
A simple DockerFile may involve two instructions, a FROM instruction and a RUN instruction.
In the embodiment of the present specification, step S3012: and constructing the Docker mirror image capable of being operated and maintained based on the operation and maintenance script, the compiling result packet and the basic Docker mirror image, namely, using the Docker File to customize the process of the mirror image. So-called customized mirroring is based on a mirror on which customization is performed. The base Docker image is required to be specified, and the FROM instruction is used for specifying the base image, so that the FROM instruction in dockerFile is a necessary instruction and is the first instruction. There are very many high quality official images on Docker Hub, and there are images of service classes that can be taken directly for use, such as nginx, redis, mysql, tomcat, etc. If no mirror image of the corresponding service is found, some more basic operating system images such as ubuntu, debian, centros, alpine, etc. are provided in the official mirror image.
The RUN instruction is used to execute command line commands. Due to the powerful capabilities of command lines, the RUN instruction is one of the most common instructions when customizing mirroring. The formats are two:
shell format: RUN < Command >
exec format: RUN [ "executable file", "parameter 1", "parameter 2" ]
Other instructions in Docker File are described in detail below:
the COPY instruction: the file is copied.
The format is as follows:
COPY < source path > a < target path >
COPY [ "< source path 1>",
the COPY instruction copies the < source path > file/directory from the build context directory to the < target path > location within the new layer of the image. Such as:
COPY package.json/usr/src/app/
the < source path > may be multiple, and may even be wildcard, such as:
COPY hom*/mydir/
COPY hom?.txt/mydir/
ADD instruction: more advanced replication of files.
The ADD instruction and COPY instruction are substantially identical in format and nature. But adds some functionality to the COPY instruction. For example, the < source path > may be a URL, in which case the Docker engine may attempt to download the linked file to the < target path >.
The method is suitable for occasions using ADD instructions and occasions needing automatic decompression.
When selecting between COPY and ADD instructions, the principle can be followed that all file copies use the COPY instruction, the ADD instruction only being used where automatic decompression is required.
A CMD instruction: a container start command.
The CMD instruction has a similar format to the RUN instruction, and has two formats:
shell format: CMD < Command >
exec format: CMD [ "executable file", "parameter 1", "parameter 2" ]
Parameter list format: CMD [ "parameter 1", "parameter 2". - ]. After the entry command is specified, the specific parameters are specified by CMD.
When starting the container, it is necessary to specify the program and parameters to be run. The CMD command is used to specify a default container master process start command.
Instypoint instruction: an entry point.
The purpose of the entry command is to specify the container initiator and parameters, as well as the CMD command. The entry point instruction can be replaced when running, but is slightly more complicated than the CMD instruction and needs to be specified by an ENTRYPOINT which is a parameter of a docker run.
When the entry instruction is specified, the meaning of the CMD instruction is changed, and the CMD instruction is not directly run, but the contents of the CMD instruction are transmitted to the entry instruction as parameters, in other words, when actually executed, the CMD instruction becomes:
<ENTRYPOINT>"<CMD>"
ENV instruction: an environment variable is set.
There are two formats:
ENV
ENV==...
this instruction is simple, i.e. setting the environment variable, whether it is the following other instruction, e.g. RUN instruction, or the application at runtime, can use the environment variable as defined herein directly.
ENV VERSION=1.0DEBUG=on NAME="Happy Feet"
$ VERSION # Environment of use variable
The following instructions may support environment variable expansion: ADD, COPY, ENV, EXPOSE, LABEL, USER, WORKDIR, VOLUME, STOPSIGNAL, ONBUILD.
The ARG instruction: and (5) constructing parameters.
The format is as follows:
ARG < parameter name > [ < default > ]
The ARG instruction and the ENV instruction both have the same effect of setting environment variables. In contrast, the ARG instructions set the environment variables of the build environment that will not exist in future container runs. But does not use the ARG instruction to save information such as passwords, so the docker history can still see all values.
The ARG instruction in Dockerfile defines the name of a parameter and defines its default value. This default value may be overwritten in the build command docker build with-build-arg < parameter name > < value >.
VOLUME instruction: an anonymous volume is defined.
The format is as follows:
VOLUME [ "< Path 1>", "[ Path 2]" ]
VOLUME < Path >
In order to prevent a user from forgetting to mount a directory stored in a dynamic file as a volume during operation, in a Docker File, some directories may be designated in advance as anonymous volumes, so that if the user does not designate the mount during operation, the application can operate normally, and a large amount of data cannot be written into the container storage layer.
VOLUME/data
The data directory is automatically mounted as an anonymous volume during operation, and any information written into the data is not recorded into the container storage layer, so that the stateless container storage layer is ensured. Of course, the runtime can override this mount setting.
Such as:
docker run-d-v mydata:/data xxxx
in this line of commands, the named volume of mydata is mounted to the location of/data, replacing the mount configuration of the anonymous volume defined in Dockerfile.
EXPOSE instruction: a port is declared.
The format is EXPOSE < Port 1> [ < Port 2> ].
The EXPOSE instruction is a declarative runtime container provisioning service port.
WORKDIR directive: a working directory is specified.
The format is WORKDIR < working directory Path >
The working directory (or current directory) may be designated using the WORKDIR command, and the current directory of later layers may be changed to the designated directory, if the directory does not exist, the WORKDIR may help the user build the directory.
The USER instruction: the current user is specified.
The format is as follows: USER < USER name >
The USER directive and WORKDIR are similar and both change the environmental state and affect the subsequent layers.
As with the work dir directive, the USER directive is only to facilitate switching to a specific USER, which must be established in advance, otherwise switching is not possible.
HEALTHCHECK instructs: and (6) health examination.
The format is as follows:
HEALTHCHECK [ options ] CMD < Command >: setting commands for checking the health of containers
HEALTHCHECK NONE: if the base image has health check instructions, its health check instructions may be masked out.
The HEALTHCHECK instruction tells the Docker how to determine if the container's status is normal. A line of commands is specified through the instruction, and whether the service state of the container main process is normal or not is judged through the line of commands, so that the actual state of the container is reflected relatively truly.
HEALTHCHECK support the following options:
-interval ═ interval of two health checks, default to 30 seconds;
-timeout ═ duration > that the health check command runs for a timeout period, and if this time is exceeded, the current health check is deemed to have failed, defaulting for 30 seconds;
-. retries ═ times >: when the specified number of consecutive failures, the container status is considered unevalth, and defaults to 3 times.
To aid in troubleshooting, the output of the health check command (including stdout and stderr) is stored in a healthy state and can be viewed using a docker insert.
In the embodiment of the description, a container mirror image is generated through a Docker build command according to a Docker file, a compilation result packet and a base Docker mirror image, so that the compilation result packet is packaged into the container mirror image, and an operable and maintainable Docker mirror image based on the compilation result packet is created.
Step S302: and starting the Docker mirror image of the operational and maintainable objects to obtain the Docker container.
Step S303: and acquiring a custom variable, wherein the custom variable is a variable related to a target site, and the target site is a site deployed by a target application.
The custom variables include at least one of: the database address of the target site, the cache address of the target site and the user login address of the target site.
Step S304: the settings of the Docker container are updated based on the custom variables.
Step S304 may specifically include: step S3041 and step S3042.
Step S3041: custom variables are input into the Docker container.
Step S3042: and updating the compiling result packet in the Docker container based on the custom variable. Updating the compiling result packet in the Docker container based on the custom variable, wherein the updating comprises the following steps: and writing the custom variable into the compiling result packet.
The environment parameters in the Docker container are updated using custom variables, including but not limited to updating the yml configuration file of the Docker container. For example, if the customized variable includes a database address of the target site, a cache address of the target site, and a user login address of the target site, the customized variable may be used to update the corresponding environment parameters in the yml configuration file of the Docker container one by one.
Writing the custom variable into the compilation result package is completed through the operation and maintenance script, after the operation and maintenance script obtains the custom variable, analyzing a configuration file (such as yml configuration file) of the Docker container according to a variable analysis script preset in the operation and maintenance script, matching parameter items in the configuration file of the Docker container with parameter items in the compilation result package one by one, and replacing parameter values corresponding to parameter items in the compilation result package by using parameter values corresponding to parameter keys in the configuration file of the Docker container when the parameter keys (namely key of the parameter items) of the parameter items in the configuration file of the Docker container are the same as the parameter keys of the parameter items in the compilation result package until all the parameter items in the configuration file of the Docker container are successfully matched and replaced in the compilation result package to complete updating of the compilation result package.
Step S305: the Docker vessel is started. Specifically, the Docker container may be started by the CMD command described above.
In the embodiment of the specification, a Docker mirror image capable of operation and maintenance is constructed based on a target application; starting a Docker mirror image capable of being operated and maintained to obtain a Docker container; obtaining a user-defined variable, wherein the user-defined variable is a variable related to a target site, and the target site is a site deployed by a target application; updating the settings of the Docker container based on the custom variables; the Docker container is started to complete delivery of the target application, and the environment required by the application is packaged integrally, so that a user does not need to pay attention to the environment and configuration of the bottom layer of the operating system, and redevelopment is not needed when the application is delivered, and therefore the technical scheme provided by the embodiment of the specification can improve the efficiency of application delivery.
Referring to fig. 4, an embodiment of the present specification provides an application delivery apparatus, including: the system comprises a building unit 10, a first starting unit 20, an obtaining unit 30, an updating unit 40 and a second starting unit 50.
And the building unit 10 is used for building a Docker mirror image capable of being operated and maintained based on the target application.
The first starting unit 20 is configured to start a Docker image of an operational service, so as to obtain a Docker container.
The obtaining unit 30 is configured to obtain a custom variable, where the custom variable is a variable related to a target site, and the target site is a site deployed by a target application.
And the updating unit 40 is used for updating the settings of the Docker container based on the custom variables.
A second actuating unit 50 for actuating the Docker vessel.
Optionally, the building unit 10 comprises: acquiring a subunit and constructing the subunit.
And the obtaining subunit is used for obtaining the operation and maintenance script of the target application, the compiling result packet of the target application and the basic Docker mirror image.
And the building subunit is used for building the Docker mirror image capable of being operated and maintained based on the operation and maintenance script, the compiling result packet and the basic Docker mirror image.
Optionally, the building subunit comprises: and the writing module and the building module.
And the writing module is used for writing the address of the basic Docker mirror image, the storage address of the compiling result packet and the storage address of the operation and maintenance script into the Docker File.
And the construction module is used for constructing a Docker mirror image capable of being operated and maintained based on the Docker File.
Optionally, the obtaining subunit includes: the system comprises a construction module, an extraction module and a compiling module.
And the acquisition module is used for acquiring the source code of the target application.
And the extraction module is used for extracting the variables in the source codes.
And the compiling module is used for compiling the source code after the variables are extracted to obtain a compiling result packet of the target application.
Optionally, the custom variables include at least one of: the database address of the target site, the cache address of the target site and the user login address of the target site.
Optionally, the updating unit 40 includes: an input subunit and an update subunit.
And the input subunit is used for inputting the user-defined variable into the Docker container.
And the updating subunit is used for updating the compiling result packet in the Docker container based on the custom variable.
Optionally, the update subunit includes: and writing into a module.
And the writing module is used for writing the custom variable into the compiling result packet.
The embodiment of the specification provides a storage medium, which comprises a stored program, wherein when the program runs, a device where the storage medium is located is controlled to execute the following steps: constructing a Docker mirror image capable of being operated and maintained based on the target application; starting a Docker mirror image capable of being operated and maintained to obtain a Docker container; obtaining a user-defined variable, wherein the user-defined variable is a variable related to a target site, and the target site is a site deployed by a target application; updating the settings of the Docker container based on the custom variables; the Docker vessel is started.
Optionally, the apparatus for controlling the storage medium when the program runs further performs the following steps: acquiring an operation and maintenance script of a target application, a compiling result packet of the target application and a basic Docker mirror image; and constructing a Docker mirror image capable of being operated and maintained based on the operation and maintenance script, the compiling result packet and the basic Docker mirror image.
Optionally, the apparatus for controlling the storage medium when the program runs further performs the following steps: writing the address of the basic Docker mirror image, the storage address of the compiling result packet and the storage address of the operation and maintenance script into a Docker File; and constructing a Docker mirror image of the operable and maintainable system based on the Docker File.
Optionally, the apparatus for controlling the storage medium when the program runs further performs the following steps: acquiring a source code of a target application; extracting variables from the source code; and compiling the source code after the variables are extracted to obtain a compiling result packet of the target application.
Optionally, the apparatus for controlling the storage medium when the program runs further performs the following steps: inputting a custom variable into a Docker container; and updating the compiling result packet in the Docker container based on the custom variable.
Optionally, the apparatus for controlling the storage medium when the program runs further performs the following steps: and writing the custom variable into the compiling result packet.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present specification, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions in actual implementation, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
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 units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present description may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a Processor (Processor) to execute some steps of the methods described in the embodiments of the present disclosure. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only a preferred embodiment of the present disclosure, and should not be taken as limiting the present disclosure, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.
Claims (15)
1. An application delivery method, the method comprising:
constructing a Docker mirror image capable of being operated and maintained based on the target application;
starting the Docker mirror image capable of being operated and maintained to obtain a Docker container;
obtaining a custom variable, wherein the custom variable is a variable related to a target site, and the target site is a site deployed by the target application;
updating the settings of the Docker container based on the custom variables;
the Docker vessel is started.
2. The method of claim 1, wherein constructing a Docker image of the operational and maintenance based on the target application comprises:
acquiring an operation and maintenance script of the target application, a compiling result packet of the target application and a basic Docker mirror image;
and constructing the Docker mirror image capable of being operated and maintained based on the operation and maintenance script, the compiling result packet and the basic Docker mirror image.
3. The method of claim 2, wherein constructing the operational and maintainable Docker image based on the operation and maintenance script, the compilation result package, and the base Docker image comprises:
writing the address of the basic Docker mirror image, the storage address of the compiling result packet and the storage address of the operation and maintenance script into a Docker File file;
and constructing the Docker mirror image of the operable dimension based on the Docker File.
4. The method of claim 2, obtaining a compilation result package for the target application, comprising:
acquiring a source code of the target application;
extracting variables from the source code;
and compiling the source code after the variable is extracted to obtain a compiling result packet of the target application.
5. The method of claim 1, the custom variables comprising at least one of: the database address of the target site, the cache address of the target site and the user login address of the target site.
6. The method of any of claims 1 to 5, the updating the settings of the Docker container based on the custom variable, comprising:
inputting the custom variable into the Docker container;
updating the compilation result package in the Docker container based on the custom variable.
7. The method of claim 6, the updating the compilation result package in the Docker container based on the custom variable, comprising:
and writing the custom variable into the compiling result packet.
8. An application delivery apparatus, the apparatus comprising:
the building unit is used for building a Docker mirror image capable of being operated and maintained based on the target application;
the first starting unit is used for starting the Docker mirror image capable of being operated and maintained to obtain a Docker container;
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a custom variable, the custom variable is a variable related to a target site, and the target site is a site deployed by a target application;
the updating unit is used for updating the settings of the Docker container based on the user-defined variables;
a second starting unit for starting the Docker container.
9. The apparatus of claim 8, the building unit comprising:
the obtaining subunit is used for obtaining the operation and maintenance script of the target application, the compiling result packet of the target application and a basic Docker mirror image;
and the building subunit is used for building the Docker mirror image capable of being operated and maintained based on the operation and maintenance script, the compiling result packet and the basic Docker mirror image.
10. The apparatus of claim 9, the building subunit comprising:
the writing module is used for writing the address of the basic Docker mirror image, the storage address of the compiling result packet and the storage address of the operation and maintenance script into a Docker File file;
and the construction module is used for constructing the Docker mirror image of the operable and maintainable system based on the Docker File file.
11. The apparatus of claim 9, the acquisition subunit comprising:
the acquisition module is used for acquiring a source code of the target application;
the extraction module is used for extracting the variables in the source codes;
and the compiling module is used for compiling the source code after the variables are extracted to obtain a compiling result packet of the target application.
12. The apparatus of claim 8, the custom variables comprising at least one of: the database address of the target site, the cache address of the target site and the user login address of the target site.
13. The apparatus according to any one of claims 8 to 12, the updating unit comprising:
the input subunit is used for inputting the user-defined variable into the Docker container;
and the updating subunit is used for updating the compiling result packet in the Docker container based on the custom variable.
14. The apparatus of claim 13, the update subunit comprising:
and the writing module is used for writing the custom variable into the compiling result packet.
15. A storage medium comprising a stored program, wherein a device on which the storage medium is located is controlled to perform the application delivery method of any one of claims 1 to 7 when the program is run.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910925958.4A CN110688137A (en) | 2019-09-27 | 2019-09-27 | Application delivery method and device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910925958.4A CN110688137A (en) | 2019-09-27 | 2019-09-27 | Application delivery method and device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110688137A true CN110688137A (en) | 2020-01-14 |
Family
ID=69110665
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910925958.4A Pending CN110688137A (en) | 2019-09-27 | 2019-09-27 | Application delivery method and device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110688137A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111596928A (en) * | 2020-05-19 | 2020-08-28 | 吉林大学 | Application control method and device and electronic equipment |
CN111897570A (en) * | 2020-07-15 | 2020-11-06 | 杭州安恒信息技术股份有限公司 | Multi-dependency file extraction method and device based on Maven plug-in |
CN113703825A (en) * | 2020-05-21 | 2021-11-26 | 顺丰科技有限公司 | Mirror image construction method and device, server and storage medium |
CN114020305A (en) * | 2021-09-10 | 2022-02-08 | 天聚地合(苏州)数据股份有限公司 | Script data configuration method and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102799444A (en) * | 2011-05-27 | 2012-11-28 | 华为软件技术有限公司 | Method and device for packaging program in different platforms |
CN107885551A (en) * | 2017-11-27 | 2018-04-06 | 山东浪潮商用系统有限公司 | A kind of service arrangement method, apparatus, computer-readable recording medium and storage control |
CN110058863A (en) * | 2019-03-16 | 2019-07-26 | 平安城市建设科技(深圳)有限公司 | Construction method, device, equipment and the storage medium of Docker container |
-
2019
- 2019-09-27 CN CN201910925958.4A patent/CN110688137A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102799444A (en) * | 2011-05-27 | 2012-11-28 | 华为软件技术有限公司 | Method and device for packaging program in different platforms |
CN107885551A (en) * | 2017-11-27 | 2018-04-06 | 山东浪潮商用系统有限公司 | A kind of service arrangement method, apparatus, computer-readable recording medium and storage control |
CN110058863A (en) * | 2019-03-16 | 2019-07-26 | 平安城市建设科技(深圳)有限公司 | Construction method, device, equipment and the storage medium of Docker container |
Non-Patent Citations (1)
Title |
---|
ZHCCL: "修改应用程序的配置的资源文件,并按配置发布应用程序工具", 《HTTPS://WWW.IT610.COM/ARTICLE/5442953.HTM》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111596928A (en) * | 2020-05-19 | 2020-08-28 | 吉林大学 | Application control method and device and electronic equipment |
CN113703825A (en) * | 2020-05-21 | 2021-11-26 | 顺丰科技有限公司 | Mirror image construction method and device, server and storage medium |
CN111897570A (en) * | 2020-07-15 | 2020-11-06 | 杭州安恒信息技术股份有限公司 | Multi-dependency file extraction method and device based on Maven plug-in |
CN111897570B (en) * | 2020-07-15 | 2024-04-12 | 杭州安恒信息技术股份有限公司 | Multi-dependency item file extraction method and device based on Maven plug-in |
CN114020305A (en) * | 2021-09-10 | 2022-02-08 | 天聚地合(苏州)数据股份有限公司 | Script data configuration method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110688137A (en) | Application delivery method and device and storage medium | |
US6938250B2 (en) | Image-based software installation | |
US9864600B2 (en) | Method and system for virtualization of software applications | |
CN111399865A (en) | Method for automatically constructing target file based on container technology | |
CN102567051B (en) | Method and device for preparing graphical installation system of Loongson platform | |
US9779111B2 (en) | Method and system for configuration of virtualized software applications | |
US8856724B2 (en) | Systems and methods for incremental software development | |
US7861177B2 (en) | Software configuration program for software applications | |
JP2021518619A (en) | Systems and methods for connector development and integrated channel deployment | |
WO2017185606A1 (en) | Overlay mechanism-based apk development method and system | |
US20090064196A1 (en) | Model based device driver code generation | |
US20080276221A1 (en) | Method and apparatus for relations planning and validation | |
CN113127098B (en) | Application program creation method based on micro-service architecture and related equipment | |
CA2737368A1 (en) | A method for localizing text in a software application | |
CN111176722B (en) | Method, device and storage medium for detecting file version of third party library | |
CN114651233A (en) | Instant container | |
US20160139917A1 (en) | Incremental source code analysis | |
US10866803B2 (en) | Generating interaction libraries | |
US20160179570A1 (en) | Parallel Computing Without Requiring Antecedent Code Deployment | |
CN114546819A (en) | Code processing method and device, electronic equipment and readable medium | |
CN113672269B (en) | Data processing method, system, electronic device and program product | |
CN101840337B (en) | Method for customizing reducing system applied to packet capture application | |
JP6861733B2 (en) | Custom-built process engine with minimal memory and disk resource consumption | |
EP4254171A1 (en) | Generation program, generation method, and information processing device | |
JP7280475B2 (en) | Information processing device, its control method, and program |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200114 |
|
RJ01 | Rejection of invention patent application after publication |