Parfum:Dockerfile气味的检测和自动修复
Parfum: Detection and Automatic Repair of Dockerfile Smells
摘要:
Docker是开发人员和组织在轻量级、可移植的容器中打包、部署和运行应用程序的流行工具。Docker的一个关键组件是Dockerfile,这是一个简单的文本文件,指定了构建Docker镜像所需的步骤。虽然Dockerfiles很容易创建和使用,但创建一个最佳镜像是很复杂的,因为很容易不遵循最佳实践,当它发生时,我们称之为Docker气味。为了提高Dockerfiles的质量,以前的工作都集中在检测Docker气味上,但他们没有提供建议或修复气味。在本文中,我们提出了Parfum,这是一种检测和自动修复Docker气味的工具,同时生成最小的补丁。Parfum基于一个新的Dockerfile AST解析器Dinghy。我们通过分析和修复大量Dockerfiles并将其与现有工具进行比较来评估Parfum的有效性。我们还根据构建失败和镜像大小来衡量修复对Docker镜像的影响。最后,我们打开了35个pull request来收集开发人员的反馈,并确保修复和气味是有意义的。我们的结果表明,Parfum能够修复806 245 Docker气味,并对Docker镜像大小产生显著影响,最后,开发人员在合并20个pull请求的同时欢迎Parfum生成的补丁。
英文摘要:
Docker is a popular tool for developers and organizations to package, deploy, and run applications in a lightweight, portable container. One key component of Docker is the Dockerfile, a simple text file that specifies the steps needed to build a Docker image. While Dockerfiles are easy to create and use, creating an optimal image is complex in particular since it is easy to not follow the best practices, when it happens we call it Docker smell. To improve the quality of Dockerfiles, previous works have focused on detecting Docker smells, but they do not offer suggestions or repair the smells. In this paper, we propose, Parfum, a tool that detects and automatically repairs Docker smells while producing minimal patches. Parfum is based on a new Dockerfile AST parser called Dinghy. We evaluate the effectiveness of Parfum by analyzing and repairing a large set of Dockerfiles and comparing it against existing tools. We also measure the impact of the repair on the Docker image in terms of build failure and image size. Finally, we opened 35 pull requests to collect developers' feedback and ensure that the repairs and the smells are meaningful. Our results show that Parfum is able to repair 806 245 Docker smells and have a significant impact on the Docker image size, and finally, developers are welcoming the patches generated by Parfum while merging 20 pull requests.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。