Lesson Objectives

  • Understanding the basic idea of Docker
  • Seeing the point of why Docker is useful

Why would I want to use Docker?

Imagine you are working on an analysis in R and you send your code to a friend. Your friend runs exactly this code on exactly the same data set but gets a slightly different result. This can have various reasons such as a different operating system, a different version of an R package, et cetera. Docker is trying to solve problems like that.

A Docker container can be seen as a computer inside your computer. The cool thing about this virtual computer is that you can send it to your friends; And when they start this computer and run your code they will get exactly the same results as you did.

Computerception

In short, you should use Docker because

  • it allows you to wrangle dependencies starting from the operating system up to details such as R and Latex package versions
  • it makes sure that your analyses are reproducible.

There are a couple of other points what Docker helps with:

  • Portability: Since a Docker container can easily be sent to another machine, you can set up everything on your own computer and then run the analyses on e.g. a more powerful machine.
  • Sharability: You can send the Docker container to anyone (who knows how to work with Docker).

Basic vocabulary

The words image and container will come up a lot in the following. An instance of an image is called container. An image is the setup of the virtual computer. If you run this image, you will have an instance of it, which we call container. You can have many running containers of the same image.

Next: Go to Lesson 02 Launching Docker or back to the main page.