Doctor: Optimizing Container Rebuild Efficiency by Instruction Re-orchestration
Zhiling Zhu, Tieming Chen, Chengwei Liu, Han Liu, Qijie Song, Zhengzi Xu, Yang Liu
摘要
Containerization has revolutionized software deployment, with Docker leading the way due to its ease of use and consistent runtime environment. As Docker usage grows, optimizing Dockerfile performance, particularly by reducing rebuild time, has become essential for maintaining efficient CI/CD pipelines. However, existing optimization approaches primarily address single builds without considering the recurring rebuild costs associated with modifications and evolution, limiting long-term efficiency gains. To bridge this gap, we present Doctor, a method for improving Dockerfile build efficiency through instruction re-ordering that addresses key challenges: identifying instruction dependencies, predicting future modifications, ensuring behavioral equivalence, and managing the optimization’s computational complexity. We developed a comprehensive dependency taxonomy based on Dockerfile syntax and a historical modification analysis to prioritize frequently modified instructions. Using a weighted topological sorting algorithm, Doctor optimizes instruction order to minimize future rebuild time while maintaining functionality. Experiments on 2,000 GitHub repositories show that Doctor improves 92.75% of Dockerfiles, reducing rebuild time by an average of 26.5%, with 12.82% of files achieving over a 50% reduction. Notably, 86.2% of cases preserve functional similarity. These findings highlight best practices for Dockerfile management, enabling developers to enhance Docker efficiency through informed optimization strategies.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
脉络
- Dockerfile Flakiness: Characterization and Repair 引用了 Empirical Study of the Docker Smells Impact on the Image Size
- Dockerfile Flakiness: Characterization and Repair 引用了 Shipwright: A Human-in-the-Loop System for Dockerfile Repair
- Empirical Study of the Docker Smells Impact on the Image Size 引用了 Shipwright: A Human-in-the-Loop System for Dockerfile Repair
它引用的 Paper4
- Shipwright: A Human-in-the-Loop System for Dockerfile RepairJordan Henkel, Denini Silva, Leopoldo Teixeira, Marcelo d'Amorim 等ICSE 2021 · 31 次引用
- Understanding and Predicting Docker Build Duration: An Empirical Study of Containerized Workflow of OSS ProjectsYiwen Wu, Yang Zhang, Kele Xu, Tao Wang 等ASE 2022 · 13 次引用
- Empirical Study of the Docker Smells Impact on the Image SizeThomas DurieuxICSE 2024 · 11 次引用
- Dockerfile Flakiness: Characterization and RepairTaha Shabani, Noor Nashid, Parsa Alian, Ali MesbahICSE 2025 · 2 次引用
相关 Paper
- Towards Efficient Build Ordering for Incremental Builds with Multiple ConfigurationsJun Lyu, Shanshan Li, He Zhang, Lanxin Yang 等FSE 2024 · 4 次引用
- Automatic Dockerfile Generation with Large Language ModelsJun Lyu, He Zhang, Yusong Yuan, Lanxin Yang 等ICSE 2026
- Automated Dependency Optimization for Artifact-Based Build SystemsHongxu Xu, Zhenyang Xu, Shane McIntosh, Chengnian SunISSTA 2026
- Refactorings and Technical Debt in Docker Projects: An Empirical StudyEmna Ksontini, Marouane Kessentini, Thiago do Nascimento Ferreira, Foyzul HassanASE 2021 · 17 次引用
- Modus: a Datalog dialect for building container imagesChris Tomy, Tingmao Wang, Earl T. Barr, Sergey MechtaevFSE 2022 · 3 次引用
