Embedded real-time container deployment method based on local mode
By building and pushing container images on a remote server to the target machine's local storage directory, and using the container engine for mirroring decompression and container creation and startup, the strong dependence problem of remote mirroring warehouses in the existing technology is solved, and efficient local container deployment and operation is achieved.
Patent Information
- Application Number
- CN202411810294.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-04-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing container deployment model based on embedded real-time operating systems has strong dependence on remote mirroring warehouses, resulting in resource occupancy and performance bottlenecks during deployment.
Using an embedded real-time container deployment method based on local mode, the container engine is used to decompress the image file and create and start the container by building a container image on a remote server and pushing it to the target machine's local storage directory.
This enables container engine to no longer rely on container mirroring warehouses to directly deploy and run containers locally, reducing dependence on remote mirroring warehouses and improving deployment efficiency and performance.
Smart Images

Figure CN119829198A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer system software, and in particular relates to an embedded real-time container deployment method based on a local mode. Background Art
[0002] The essence of container technology is a virtualization technology that can provide lightweight virtualization to isolate processes and resources, effectively divide resources managed by a single operating system into different containers, and enable container users to obtain resource isolation at the container view level, solving conflicts in resource usage. Compared with traditional embedded virtual machines, container technology can virtualize a single application. Therefore, running the same number of applications using container technology takes up fewer resources than simply using virtual machines, and has higher operating performance. Therefore, when the total amount of hardware platform resources and overall performance are limited on an embedded hardware platform, container technology is used based on an embedded real-time operating system to achieve lightweight isolation while also sharing resources between the container and the host.
[0003] The container deployment mode based on embedded real-time operating systems is usually based on the deployment method of remote image repositories. After the container project is compiled and built, it is transferred to the remote server to build the image file, and then the built container image file is pushed to the remote image repository. When you need to run a container, first use the pull command of the container engine to pull the required container image from the remote image repository to the local target machine and decompress it, and then execute the create, start or run command of the container engine to create and start or directly run the specified container. This deployment mode has a strong dependence on the remote image repository. Summary of the invention
[0004] In view of this, the strong dependence on the remote image repository is avoided by packaging and pushing the container image to the target machine and decompressing and running the container image locally.
[0005] The technical solution of the present invention is:
[0006] A method for deploying an embedded real-time container based on a local mode: after the container project is compiled and built on the build side, the corresponding files are transferred to a remote server to build the container image. After the image building is completed, the image file is pushed to the local storage directory of the target machine. The container engine performs a decompression step on the local image file, decompresses the corresponding files required to start the container to the corresponding working directory, and finally creates and starts or directly runs the corresponding container through the container engine.
[0007] Furthermore, the deployment method is completed through two steps: a step of packaging the container image and pushing it to the target machine, and a step of locally decompressing and running the container image;
[0008] The execution of container image packaging and pushing to the target machine is completed based on the development environment, which is used to execute the corresponding script files for image packaging and pushing;
[0009] The execution of local decompression and operation of the container image depends on the container engine. The container engine is used to decompress the image file pushed to the target machine and generate a working directory and files for the container engine to start and run the container.
[0010] Furthermore, the steps of packaging the container image and pushing it to the target machine specifically include:
[0011] S101: Compiling and building the container project are completed on the build side;
[0012] S102: Enter the local file directory and transfer the file constructed in S101 to the remote server via FTP;
[0013] S103: Execute the buildah bulid command on the remote server to complete the image building of the file transferred in S102;
[0014] S104: Execute the buildah push$imageId oci-achive:$imageName.tar command on the remote server to compress the description file, configuration file, and image layer file in the image building completed in S103 into one file;
[0015] S105: decompress the compressed file implemented in S104 to a specified directory on the remote server, and transfer the decompressed description file, configuration file and image layer file to the specified directory of the target machine via FTP.
[0016] Furthermore, the steps of decompressing and running the container image locally specifically include:
[0017] S201: Initialize and start the container engine;
[0018] S202: After the container engine is initialized, the image layer file stored locally on the target machine is decompressed to a specified working directory;
[0019] S203: Execute the create, start, or run command through the command line to create and start or directly run the specified container in the specified working directory.
[0020] The beneficial effects of the present invention are:
[0021] The container engine of the present invention no longer relies on the container image repository and can directly deploy and run the corresponding container locally. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0023] Figure 1 Represented as a workflow instance diagram for container-local deployment mode.
[0024] Figure 2 Represented as a traditional container image repository deployment model workflow instance diagram. DETAILED DESCRIPTION
[0025] The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0026] The following describes the embodiments of the present disclosure through specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.
[0027] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein can be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects described herein can be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein can be used to implement this device and / or practice this method.
[0028] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present disclosure. The illustrations only show components related to the present disclosure rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0029] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.
[0030] In one embodiment of the present invention, a method for deploying an embedded real-time container based on a local mode is proposed: after the container project is compiled and built on the build side, the corresponding files are transferred to the remote server to execute the construction of the container image. After the image construction is completed, the image file is pushed to the local storage directory of the target machine. The container engine performs a decompression step on the local image file, decompresses the corresponding files required to start the container to the corresponding working directory, and finally creates and starts or directly runs the corresponding container through the container engine.
[0031] In this embodiment, the deployment method is completed through two steps: a step of packaging and pushing the container image to the target machine and a step of locally decompressing and running the container image;
[0032] The execution of container image packaging and pushing to the target machine is completed based on the development environment, which is used to execute the corresponding script files for image packaging and pushing;
[0033] The execution of local decompression and operation of the container image depends on the container engine. The container engine is used to decompress the image file pushed to the target machine and generate a working directory and files for the container engine to start and run the container.
[0034] In this embodiment, the steps of packaging the container image and pushing it to the target machine specifically include:
[0035] S101: Compiling and building the container project are completed on the build side;
[0036] S102: Enter the local file directory and transfer the file constructed in S101 to the remote server via FTP;
[0037] S103: Execute the buildah bulid command on the remote server to complete the image building of the file transferred in S102;
[0038] S104: Execute the buildah push$imageId oci-achive:$imageName.tar command on the remote server to compress the description file, configuration file, and image layer file in the image building completed in S103 into one file;
[0039] S105: decompress the compressed file implemented in S104 to a specified directory on the remote server, and transfer the decompressed description file, configuration file and image layer file to the specified directory of the target machine via FTP.
[0040] In this embodiment, the steps of locally decompressing and running the container image specifically include:
[0041] S201: Initialize and start the container engine;
[0042] S202: After the container engine is initialized, the image layer file stored locally on the target machine is decompressed to a specified working directory;
[0043] S203: Execute the create, start, or run command through the command line to create and start or directly run the specified container in the specified working directory.
[0044] In this embodiment, the embedded real-time operating system is started and loaded on the embedded platform, the container engine is run, and the compilation and construction of the container project are performed based on the embedded development environment. The workflow steps of the container local deployment mode are as follows:
[0045] 1. Compile and build container projects in an embedded development environment;
[0046] 2. After the build is complete, click the container image push button in the development environment to transfer the intermediate state file of the container built locally to the remote server via FTP;
[0047] 3. Build the container image on the remote server, usually by executing the buildah build command and the buildah push oci-archive command, to build a container image in the standard OCI format and compress it into a compressed package in the specified tar format;
[0048] 4. Use the tar xf command to decompress the OCI image compressed package to a temporary directory to obtain the image description file manifest file, image configuration file config file and image layer file layer file;
[0049] 5. Transfer the obtained manifest file, config file and layer file to the storage directory specified by the target machine via FTP;
[0050] 6. Execute the unpack command of the container engine, parse the image description file and configuration file, and decompress the image layer file to the specified bundle working directory;
[0051] 7. After the image layer file is decompressed, you can execute the create and start commands of the container engine to create and start the specified container, or directly run the specified container through the run command of the container engine. The entire container deployment process is completed and no longer has a strong dependency on the remote image repository.
[0052] The above is only a specific implementation of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present disclosure should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A method for deploying an embedded real-time container based on local mode, characterized in that After the container project is compiled and built on the build side, the corresponding files are transferred to the remote server to build the container image. After the image is built, the image file is pushed to the local storage directory of the target machine. The container engine performs the decompression step on the local image file and decompresses the corresponding files required to start the container to the corresponding working directory. Finally, the container engine creates and starts or directly runs the corresponding container.
2. The deployment method according to claim 1, characterized in that: The deployment method is completed through two steps: a step of packaging and pushing the container image to the target machine and a step of locally decompressing and running the container image; The execution of container image packaging and pushing to the target machine is completed based on the development environment, which is used to execute the corresponding script files for image packaging and pushing; The execution of local decompression and operation of the container image depends on the container engine. The container engine is used to decompress the image file pushed to the target machine and generate a working directory and files for the container engine to start and run the container.
3. The deployment method according to claim 2, characterized in that: The steps for packaging and pushing container images to the target machine include: S101: Compiling and building the container project are completed on the build side; S102: Enter the local file directory and transfer the file constructed in S101 to the remote server via FTP; S103: Execute the buildah bulid command on the remote server to complete the image building of the file transferred in S102; S104: Execute the buildah push$imageId oci-achive:$imageName.tar command on the remote server to compress the description file, configuration file, and image layer file in the image building completed in S103 into one file; S105: decompress the compressed file implemented in S104 to a specified directory on the remote server, and transfer the decompressed description file, configuration file and image layer file to the specified directory of the target machine via FTP.
4. The deployment method according to claim 3, characterized in that: The steps for decompressing and running the container image locally include: S201: Initialize and start the container engine; S202: After the container engine is initialized, the image layer file stored locally on the target machine is decompressed to a specified working directory; S203: Execute the create, start, or run command through the command line to create and start or directly run the specified container in the specified working directory.
Citation Information
Patent Citations
Mirror image construction method, system and device and medium
CN112363803A
Continuous integration and delivery system and method, electronic equipment and storage medium
CN113434194A
Interface configuration system and method for container in embedded system
CN115827045A