大数据 ›› 2021, Vol. 7 ›› Issue (1): 64-75.doi: 10.11959/j.issn.2096-0271.2021005

• 专题:数据驱动的软件智能化开发 • 上一篇    

基于领域知识的Docker镜像自动构建方法

陈伟1,2, 叶宏杰1,2, 周家宏1,2, 魏峻1,2   

  1. 1 中国科学院大学,北京 100190
    2 中国科学院软件研究所,北京 100190
  • 出版日期:2021-01-15 发布日期:2021-01-01
  • 作者简介:陈伟(1980- ),男,博士,中国科学院软件研究所副研究员,中国计算机学会会员,主要研究方向为软件工程、网络分布式计算等。
    叶宏杰(1996- ),男,中国科学院软件研究所硕士生,主要研究方向为软件工程
    周家宏(1995- ),男,中国科学院软件研究所硕士生,主要研究方向为机器学习、知识图谱等
    魏峻(1970- ),男,博士,中国科学院软件研究所研究员、博士生导师,主要研究方向为软件工程、网络分布式计算等
  • 基金资助:
    国家自然科学基金资助项目(2016YFB1000800);国家自然科学基金资助项目(61732019)

An approach to automatically building Docker images by using domain knowledge

Wei CHEN1,2, Hongjie YE1,2, Jiahong ZHOU1,2, Jun WEI1,2   

  1. 1 University of Chinese Academy of Sciences, Beijing 100190, China
    2 Institute of Software, Chinese Academy of Sciences, Beijing 100190, China
  • Online:2021-01-15 Published:2021-01-01
  • Supported by:
    The National Key Research and Development Program of China(2016YFB1000800);The National Natural Science Foundation of China(61732019)

摘要:

Dockerfile是构建Docker应用镜像的脚本代码,包含软件系统镜像构建所需的软件包及其依赖的下载、安装和配置的所有指令。编写Dockerfile需要丰富的领域知识,否则编写的Dockerfile容易产生镜像构建错误。针对此问题,提出一种基于领域知识的Docker镜像自动构建方法。该方法通过对大规模Dockerfile的自动解析,分析提取构建Docker镜像所需的软件依赖及安装配置等领域知识;在面向特定软件系统构建镜像时,从已构建的领域知识库中分析推断指定软件的依赖关系及安装操作,生成Dockerfile来构建Docker镜像。实验结果表明,该方法具有利用领域知识推断系统依赖关系和软件包安装方式、生成不同软件Dockerfile的能力。

关键词: Docker, Dockerfile, 知识图谱, 软件包, 系统依赖

Abstract:

A Dockerfile builds a Docker image by specifying how to construct a software system by downloading, installing and configuring software packages and their dependencies. However, manually writing a Dockerfile can be error-prone because system dependency resolution requires a lot of domain knowledge. Therefore, an approach to automating Dockerfile generation based on domain knowledge was proposed. The approach automatically parses Dockerfiles and extracts knowledge of building Docker images and stores the knowledge in a graph database. When generating new Dockerfiles, the system dependencies and their installation operations for the designated software based on the knowledge base were inferred. Experiments indicate that it is viable to automate Dockerfile generation for diversified software by inferring system dependencies and software package installations with the domain knowledge.

Key words: Docker, Dockerfile, knowledge graph, software package, system dependency

中图分类号: 

No Suggested Reading articles found!