Skip to content

Working with Docker

What is Docker?

Docker images are a helpful way to ensure that all contributors are able to run analysis in the same environment. A Docker image compiles all packages, dependencies, and specified versions in a single portable image. In short, Docker is a key tool we use to ensure reproducibility.

By using the same Docker image, contributors can run the same analysis on different machines and get the same results.

Why do I need Docker?

Using Docker with OpenScPCA is optional, but highly recommended. A docker image will be created and available for each analysis module. This ensures reproducibility of that analysis module across any machine that is used.

For example, if you work on your analysis locally and on Lightsail for Research, working in a Docker container ensures reproducible results.

We will also use Docker images to run the analysis modules in the OpenScPCA-nf workflow when generating final analysis results.

How to install Docker

macOS users

Follow the instructions to Install Docker Desktop on Mac on the Docker website.

Apple silicon (M-series) Mac users

After installing Docker, we recommend that Apple silicon Mac users follow these additional steps:

  1. Install Rosetta 2 as described in the "System Requirements" section in the "Mac with Apple silicon" tab by running the following in the terminal:

    # Install Rosetta 2, following instructions when prompted
    softwareupdate --install-rosetta
    
  2. Enable Rosetta emulation in the Docker Desktop Settings. In the "General" settings tab, make sure the following are turned on:

    • "Use containerd for pulling and storing images"
    • "Use Virtualization framework"
    • "Use Rosetta for x86_64/amd64 emulation on Apple Silicon"

Windows users

To enable Docker on the WSL 2 side of your computer, you will need to turn on Docker's built-in WSL 2 feature. Once enabled, you will be able to run Docker from the Ubuntu terminal.

Follow the instructions to install Docker Desktop and enable the WSL 2 feature on the Docker website.