IEEE Access (Jan 2019)
An Empirical Case Study on the Temporary File Smell in Dockerfiles
Abstract
Docker is widely used in data centers to host services. The docker image adopts a hierarchical storage architecture, which means that the docker image is composed of a set of filesystem layers. In the image building process, only the top layer is read-write, while the bottom layers are all read-only. However, temporary files are often used in the image building process. Nevertheless, if a temporary file is imported and removed in different layers by a careless developer, it will lead a file redundancy. We termed this problem “temporary file smell.” This smell leads to larger-size images, which seriously restricts the efficiency of image distribution and thus affects the scaling ability of services in facing of sudden high load. To address this problem, we make an empirical case study to the real-world Dockerfiles on DockerHub. Based on the case study, we summarize four different smell patterns and propose a state-depend static analysis method to detect this kind of smells. We also provide three feasible fixing methods as selective options to eliminate the temporary file smell.
Keywords