forked from jsta/r-docker-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path01-what-and-why.Rmd
68 lines (51 loc) · 2.26 KB
/
01-what-and-why.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
title: "What is Docker and Why should I use it?"
output:
dcTemplate::dc_lesson_template:
fig_width: 6
fig_height: 6
highlight: pygments
---
```{r knitr_init, echo = FALSE, cache = FALSE}
library(knitr)
## Global options
options(max.print = "75")
opts_chunk$set(cache = TRUE,
prompt = FALSE,
tidy = TRUE,
comment = "> #",
message = FALSE,
warning = FALSE)
opts_knit$set(width = 75)
```
## 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](files/computer.jpg)
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
containter. You can have many running containers of the same image.
Next: Go to [Lesson 02 Launching Docker](02-Launching-Docker.html) or back to the
[main page](http://ropenscilabs.github.io/r-docker-tutorial/).