Skip to main content
QUICK REVIEW

[Paper Review] An introduction to Docker for reproducible research, with examples from the R environment

Carl Boettiger|arXiv (Cornell University)|Oct 2, 2014
Scientific Computing and Data ManagementDecision Sciences12 references369 citations
TL;DR

This paper introduces Docker as a solution to computational reproducibility challenges in scientific research, particularly in the R environment. By leveraging OS-level virtualization, container portability, and versioned images, Docker enables researchers to encapsulate entire computational environments, ensuring consistent execution across platforms and significantly reducing dependency-related failures in reproducible research workflows.

ABSTRACT

As computational work becomes more and more integral to many aspects of scientific research, computational reproducibility has become an issue of increasing importance to computer systems researchers and domain scientists alike. Though computational reproducibility seems more straight forward than replicating physical experiments, the complex and rapidly changing nature of computer environments makes being able to reproduce and extend such work a serious challenge. In this paper, I explore common reasons that code developed for one research project cannot be successfully executed or extended by subsequent researchers. I review current approaches to these issues, including virtual machines and workflow systems, and their limitations. I then examine how the popular emerging technology Docker combines several areas from systems research - such as operating system virtualization, cross-platform portability, modular re-usable elements, versioning, and a `DevOps' philosophy, to address these challenges. I illustrate this with several examples of Docker use with a focus on the R statistical environment.

Motivation & Objective

  • Address the growing challenge of computational reproducibility in scientific research due to complex, evolving software environments.
  • Highlight the limitations of existing approaches like virtual machines and workflow systems in supporting reproducibility for domain scientists.
  • Demonstrate how Docker’s lightweight containerization, portability, and versioning can overcome technical barriers to code reuse and replication.
  • Illustrate practical applications of Docker in the R statistical computing environment to support reproducible, shareable, and extensible research.
  • Promote adoption of Docker as a tool that reduces technical barriers to code sharing, thereby supporting cultural shifts toward open and reproducible science.

Proposed method

  • Use Docker’s OS-level virtualization (via Linux containers) to encapsulate complete computational environments, including system libraries and R dependencies.
  • Implement modular, reusable container images that bundle R, R packages, and analysis code into a single deployable unit.
  • Leverage Docker’s versioning system to track changes to container images and enable rollback to specific, reproducible states.
  • Integrate Docker with existing reproducible research tools such as dynamic documents (e.g., R Markdown) and dependency managers (e.g., R’s packrat).
  • Archive full container images as tarballs to preserve bitwise-identical snapshots of computational environments used in published results.
  • Demonstrate cross-platform deployment of R-based analyses across different operating systems using Docker containers.

Experimental results

Research questions

  • RQ1How can Docker mitigate the problem of 'dependency hell' in scientific computing, especially in R-based research?
  • RQ2To what extent can Docker improve the portability and reproducibility of R-based data analyses across different computing environments?
  • RQ3What are the technical and practical limitations of using Docker for reproducible research in scientific domains?
  • RQ4How does Docker’s approach compare to traditional methods like virtual machines or workflow systems in supporting reproducibility?
  • RQ5Can Docker reduce barriers to code reuse and thereby influence cultural norms around sharing in scientific research?

Key findings

  • Docker effectively addresses dependency hell by packaging all required system and software dependencies into a single, portable container image.
  • Containerized R environments ensure consistent execution across different platforms, significantly reducing environment-related failures in reproducible research.
  • Docker’s versioning system allows for rollback to prior states of container images, though it cannot revert individual layers—requiring explicit tarball archiving for bit-for-bit reproducibility.
  • The use of Docker in conjunction with R tools like R Markdown and packrat enables full reproducibility of analyses, including dynamic document generation.
  • Despite its advantages, Docker’s reliance on the Linux kernel limits its use on non-Linux systems, where full virtualization (e.g., via boot2docker) is required, affecting performance and usability.
  • The paper concludes that Docker has strong potential to improve reproducibility in science, but widespread adoption in research communities remains uncertain and depends on cultural and technical adoption.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.