US 11,656,893 B2
Container dockerfile and container mirror image quick generation methods and systems
Zhuo Song, Hunan (CN); Gen Li, Hunan (CN); Xu Zhou, Hunan (CN); Chouxian Ma, Hunan (CN); Chenglong Xie, Hunan (CN); Kan Wu, Hunan (CN); Zhaohui Sun, Hunan (CN); Xiali Xu, Hunan (CN); Chungen Yi, Hunan (CN); Yao Yang, Hunan (CN); Lixia Zhao, Hunan (CN); Wenfei Ning, Hunan (CN); Jun Chuan, Hunan (CN); Junxiang Tang, Hunan (CN); Delong Zhu, Hunan (CN); Haibo Mao, Hunan (CN); Yanhuang Jiang, Hunan (CN); and Yanfei Li, Hunan (CN)
Assigned to GENETALKS BIO-TECH (CHANGSHA) CO., LTD., Hunan (CN)
Appl. No. 16/618,402
Filed by GENETALKS BIO-TECH (CHANGSHA) CO., LTD., Hunan (CN)
PCT Filed Nov. 21, 2018, PCT No. PCT/CN2018/116558
§ 371(c)(1), (2) Date Dec. 2, 2019,
PCT Pub. No. WO2019/153829, PCT Pub. Date Aug. 15, 2019.
Claims priority of application No. 201810145672.X (CN), filed on Feb. 12, 2018.
Prior Publication US 2020/0293354 A1, Sep. 17, 2020
Int. Cl. G06F 9/455 (2018.01); G06F 8/61 (2018.01); G06F 9/48 (2006.01); G06F 9/54 (2006.01)
CPC G06F 9/45558 (2013.01) [G06F 8/63 (2013.01); G06F 9/485 (2013.01); G06F 9/54 (2013.01)] 15 Claims
OG exemplary drawing
 
1. A container Dockerfile quick generation method, comprising:
step 1) running a target application to be packed, performing a program tracking mode for the target application, and recording operation system dependencies of the target application while running the target application in an operation system, wherein the program tracking mode for the target application is one of a dynamic binary translation and a dynamic link library hijack;
step 2) organizing and constructing a file list required for packaging the target application to a container mirror image according to the operation system dependencies; and
step 3) generating a Dockerfile and a file creation directory of the container mirror image used for packaging the target application to the container mirror image according to the file list required for packaging the target application to the container mirror image, wherein the step 1) comprises:
step 1.1) isolating the target application to be packed in an independent process space of the operation system, initially generating running parameters of the target application and running the target application based on the running parameters and iteratively performing a round of the program tracking mode for the target application, wherein system calls in the independent process space of the operation system is a sole channel for the target application interacted with outside, and all of the system calls of the target application are monitored;
step 1.2) collecting environment variables and environment variable values required for running the target application and adding environment variable dependencies to the operation system dependencies while running the target application;
step 1.3) monitoring the system calls while running the target application, wherein types of the system calls comprise a system call for files, a system call for process creating, a system call for local inter-process communication, and a system call for sharing kernel objects, wherein the system calls comprise an executive body, and the executive body comprises the target application, a process created by the target application through the system call for process creating, and a process restarted by the target application after the target application performs the system call for local inter-process communication and the system call for sharing kernel objects, wherein when the target application performs the system call for local inter-process communication and the system call for sharing kernel objects, acquiring starting parameters of a called process, killing the called process and restarting the called process based on the acquired starting parameters by the program tracking mode, and recording file dependencies of the operation system dependencies, process dependencies of the operation system dependencies, and communication process dependencies of the operation system dependencies, wherein the file dependencies of the operation system dependencies are related to the files corresponding to the system call for the files, the process dependencies of the operation system dependencies are related to the process created by the target application through the system call for process creating, and the communication process dependencies of the operation system dependencies are related to the process the system call for local inter-process communication and the system call for sharing kernel objects;
step 1.4) judging whether the target application ends operation or an operation time of the target application exceeds a preset time threshold;
step 1.5) judging whether the operation system dependencies obtained by performing the round of the program tracking mode for the target application are added new dependencies of the operation system dependencies in response to the target application ends the operation or the operation time of the target application exceeds the preset time threshold,
changing the running parameters of the target application, running the target application based on the changed running parameters and iteratively performing a next round of the program tracking mode for the target application to jump to the step 1.2) in response to the operation system dependencies are added the new dependencies of the operation system dependencies; and
jumping to the step 2) in response to the operation system dependencies are not added the new dependencies of the operation system dependencies.