Fixing Dockerfile smells: an empirical study
Open Access
- 6 July 2024
- journal article
- research article
- Published by Springer Nature in Empirical Software Engineering
- Vol. 29 (5) , 1-26
Abstract
Docker is the de facto standard for software containerization. A Dockerfile contains the requirements to build a Docker image containing a target application. There are several best practice rules for writing Dockerfiles, but the developers do not always follow them. Violations of such practices, known as Dockerfile smells, can negatively impact the reliability and performance of Docker images. Previous studies showed that Dockerfile smells are widely diffused, and there is a lack of automatic tools that support developers in fixing them. However, it is still unclear what Dockerfile smells get fixed by developers and to what extent developers would be willing to fix smells in the first place. The aim of our study is twofold. First, we want to understand what Dockerfiles smells receive more attention from developers, i.e., are fixed more frequently in the history of open-source projects. Second, we want to check if developers are willing to accept changes aimed at fixing Dockerfile smells (e.g., generated by an automated tool), to understand if they care about them. We evaluated the survivability of Dockerfile smells from a total of 53,456 unique Dockerfiles, where we manually validated a large sample of smell-removing commits to understand (i) if developers performed the change with the intention of removing bad practices, and (ii) if they were aware of the removed smell. In the second part, we used a rule-based tool to automatically fix Dockerfile smells. Then, we proposed such fixes to developers via pull requests. Finally, we quantitatively and qualitatively evaluated the outcome after a monitoring period of more than 7 months. The results of our study showed that most developers pay more attention to changes aimed at improving the performance of Dockerfiles (image size and build time). Moreover, they are willing to accept the fixes for the most common smells, with some exceptions (e.g., missing version pinning for OS packages).Keywords
All Related Versions
Funding Information
- Università degli Studi del Molise
This publication has 17 references indexed in Scilit:
- An empirical study on self-admitted technical debt in DockerfilesEmpirical Software Engineering, 2022
- Refactorings and Technical Debt in Docker Projects: An Empirical Study2021
- Sampling Projects in GitHub for MSR Studies2021
- Revisiting Dockerfiles in Open Source Software Over Time2021
- Latest Image Recommendation Method for Automatic Base Image Update in Dockerfile2020
- A Large-scale Data Set and an Empirical Study of Docker Images Hosted on Docker Hub2020
- Characterizing the Occurrence of Dockerfile Smells in Open-Source Software: An Empirical StudyIEEE Access, 2020
- World of Code: An Infrastructure for Mining the Universe of Open Source VCS Data2019
- An Empirical Analysis of the Docker Container Ecosystem on GitHub2017
- Technical Debt: From Metaphor to Theory and PracticeIEEE Software, 2012