[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-86470-en":3,"doc-seo-86470-105":30,"detail-sidebar-cat-0-en-105":91},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":20,"is_deleted":4,"is_public":21,"is_downloadable":21,"audit_status":21,"page_count":22,"language":23,"language_code":24,"site_id":25,"html_lang":24,"table_of_contents":26,"faqs":27,"seo_title":13,"seo_description":14,"update_tm":28,"read_time":29},86470,8796095461610,"Oliver","https://ap-avatar.wpscdn.com/davatar_276721f389ce27ea32af1340a28f341c",8,"Research & Report","ML in a Box: Analyzing Containerization Practices in Open Source ML Projects","Containerization has become essential in machine learning by ensuring reproducibility, portability, and consistent environments, yet prior work mainly inspects Dockerfile structure and generic best practices. This study examines how iterative ML workflows shape container footprint, build performance, and caching behavior through analysis of 1,993 ML-related Dockerfiles plus qualitative review of refactoring practices. Containers play distinct roles across training, inference, and infrastructure, are large on average (10.27 GB), and require long builds (8.84 minutes). Build activity often wastes effort: 71% of rebuild work is redundant.","ML in a Box: Analyzing Containerization Practices in Open  \nSource ML Projects  \narXiv :2607 . 10 126v 1 [ cs . SE] 11 Jul 2026  \nFatenJebari  \nGrand Valley State University  \nMichigan, USA [jebarif@mail.gvsu.edu](jebarif@mail.gvsu.edu)  \nAmine Barrak  \nOakland University  \nMichigan, USA [aminebarrak@oakland.edu](aminebarrak@oakland.edu)  \nAbstract  \nContainerization has become increasingly essential in the machine learning (ML) domain, providing reproducibility, portability, and environment consistency. While prior studies have analyzed Dockerfile structures and best practices, none have examined ML projects in depth to reveal how the iterative nature of ML workflows influences container footprint, build performance, and caching behavior.  \nWe present the first large scale empirical study of 1,993 ML related Dockerfiles, combining quantitative analysis of container roles in ML projects and build dynamics with a qualitative investigation of refactoring practices. Results show that containers serve distinct roles across training, inference, and infrastructure. Containers are typically large, averaging 10.27 GB in size, and require long build times of about 8.84 minutes. We find that 44.4% of commits trigger rebuilds, primarily due to context file changes (96.4%), with experimentation being the main motive behind those commits that initiate rebuilds. Despite partial cache reuse, 71% of rebuild work is wasted on redundant computation. From stable projects, we identify 7 recurring ML-specific Dockerfile refactoring patterns that improve build efficiency and reduce container footprint.  \nCCS Concepts  \n• Software and its engineering → Software configuration management and version control systems; Software maintenance tools; • Computing methodologies → Machine learning; • Information systems → Empirical software engineering.  \nKeywords  \nContainerization, Dockerfile, Machine Learning (ML), Build Performance, Cache, Continuous Integration (CI/CD) .  \nACM Reference Format:  \nFatenJebari, Emna Ksontini, Amine Barrak, and Wael Kessentini. 2026. ML in a Box: Analyzing Containerization Practices in Open Source ML Projects. In 23rd International Conference on Mining Software Repositories (MSR’26), April 13–14, 2026, Rio de Janeiro, Brazil. ACM, New York, NY, USA, 11 pages. [https://doi.org/10.1145/3793302.3793344](https://doi.org/10.1145/3793302.3793344)  \nThis work is licensed under a Creative Commons Attribution 4 .0 International License. MSR’26, Rio de Janeiro, Brazil  \n© 2026 Copyright held by the owner/author(s) .  \nACM ISBN 979-8-4007-2474-9/2026/04  \n[https://doi.org/10.1145/3793302.3793344](https://doi.org/10.1145/3793302.3793344)  \nEmna Ksontini  \nUniversity of North Carolina Wilmington  \nNorth Carolina, USA  \n[ksontinie@uncw.edu](ksontinie@uncw.edu)  \nWael Kessentini  \nDePaul University  \nIllinois, USA  \n[wkessent@depaul.edu](wkessent@depaul.edu)  \n1 Introduction  \nContainerization has become the standard foundation for building, testing, and deploying software systems. Teams use containers to encapsulate dependencies, standardize runtime environments across different operating systems and infrastructures, and simplify CI/CD processes [10] . Compared to heavy virtualization, containers provide lower overhead and faster startup times, making them appealing not only for production microservices but also for developer tools and data pipelines. In practice, container images now serve as the main unit of delivery and the center of automation for much of modern software engineering [6, 29] .  \nMachine learning (ML) projects intensify the same needs, portability, repeatability, and automation, while adding hardware and dependency demands that stress container workflows. Training pipelines must coordinate large framework stacks, accelerator drivers (e.g., CUDA/cuDNN), and toolchains [9] and serving pipelines must package models for diverse targets (CPU/GPU) [5, 19] . Prior empirical work on ML projects reports the broad and routine use ","cbCaiaQSFjXIJshA","https://ap.wps.com/l/cbCaiaQSFjXIJshA","pdf",1015359,3,1,11,"English","en",105,"# Abstract\n# Introduction\n## Background and motivation\n## Iterative ML workflows and Docker build caching\n# Key study goals","[{\"question\":\"How does ML iteration affect Docker image rebuilds and caching?\",\"answer\":\"Docker builds are linear and layered, so cache breaks cause the current and all subsequent instructions to be re-executed. In ML workflows, frequent edits to code and configuration can trigger rebuilds and reduce cache effectiveness.\"},{\"question\":\"What proportion of commits trigger Docker rebuilds in the study?\",\"answer\":\"44.4% of commits trigger rebuilds, with most rebuilds caused by changes to context files (96.4%).\"},{\"question\":\"What results identify common improvements to Dockerfile refactoring?\",\"answer\":\"From stable projects, the study identifies seven recurring ML-specific Dockerfile refactoring patterns that improve build efficiency and reduce container footprint.\"}]",1784211913,28,{"code":4,"msg":31,"data":32},"ok",{"site_id":25,"language":24,"slug":33,"title":13,"keywords":34,"description":14,"schema_data":35,"social_meta":86,"head_meta":88,"extra_data":90,"updated_unix":28},"ml-in-a-box-analyzing-containerization-practices-in-open-source-ml-projects","",{"@graph":36,"@context":85},[37,53,68],{"@type":38,"itemListElement":39},"BreadcrumbList",[40,44,48,50],{"item":41,"name":42,"@type":43,"position":21},"https://docshare.wps.com","Home","ListItem",{"item":45,"name":46,"@type":43,"position":47},"https://docshare.wps.com/document/","Document",2,{"item":49,"name":12,"@type":43,"position":20},"https://docshare.wps.com/document/research-report/",{"item":51,"name":13,"@type":43,"position":52},"https://docshare.wps.com/document/ml-in-a-box-analyzing-containerization-practices-in-open-source-ml-projects/86470/",4,{"url":51,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":24,"description":14,"dateModified":61,"datePublished":62,"encodingFormat":60,"isAccessibleForFree":63,"interactionStatistic":64},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":41,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-07-27","2026-07-16",true,{"@type":65,"interactionType":66,"userInteractionCount":20},"InteractionCounter",{"@type":67},"ViewAction",{"@type":69,"mainEntity":70},"FAQPage",[71,77,81],{"name":72,"@type":73,"acceptedAnswer":74},"How does ML iteration affect Docker image rebuilds and caching?","Question",{"text":75,"@type":76},"Docker builds are linear and layered, so cache breaks cause the current and all subsequent instructions to be re-executed. In ML workflows, frequent edits to code and configuration can trigger rebuilds and reduce cache effectiveness.","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"What proportion of commits trigger Docker rebuilds in the study?",{"text":80,"@type":76},"44.4% of commits trigger rebuilds, with most rebuilds caused by changes to context files (96.4%).",{"name":82,"@type":73,"acceptedAnswer":83},"What results identify common improvements to Dockerfile refactoring?",{"text":84,"@type":76},"From stable projects, the study identifies seven recurring ML-specific Dockerfile refactoring patterns that improve build efficiency and reduce container footprint.","https://schema.org",{"og:url":51,"og:type":87,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":89,"canonical":51},"index,follow",{"doc_id":7,"site_id":25},{"code":4,"msg":5,"data":92},[93,97,101,105,110,115,120,123,128,131,135],{"id":21,"doc_module":4,"doc_module_name":46,"category_name":94,"show_sort_weight":95,"slug":96},"Story & Novel",90,"story-novel",{"id":47,"doc_module":4,"doc_module_name":46,"category_name":98,"show_sort_weight":99,"slug":100},"Literature",80,"literature",{"id":52,"doc_module":4,"doc_module_name":46,"category_name":102,"show_sort_weight":103,"slug":104},"Exam",70,"exam",{"id":106,"doc_module":4,"doc_module_name":46,"category_name":107,"show_sort_weight":108,"slug":109},5,"Comic",60,"comic",{"id":111,"doc_module":4,"doc_module_name":46,"category_name":112,"show_sort_weight":113,"slug":114},6,"Technology",50,"technology",{"id":116,"doc_module":4,"doc_module_name":46,"category_name":117,"show_sort_weight":118,"slug":119},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":46,"category_name":12,"show_sort_weight":121,"slug":122},30,"research-report",{"id":124,"doc_module":4,"doc_module_name":46,"category_name":125,"show_sort_weight":126,"slug":127},9,"Religion & Spirituality",20,"religion-spirituality",{"id":126,"doc_module":4,"doc_module_name":46,"category_name":129,"show_sort_weight":126,"slug":130},"World Cup","world-cup",{"id":132,"doc_module":4,"doc_module_name":46,"category_name":133,"show_sort_weight":132,"slug":134},10,"Lifestyle","lifestyle",{"id":136,"doc_module":4,"doc_module_name":46,"category_name":137,"show_sort_weight":106,"slug":138},19,"General","general"]