Skip to content

Commit 429d9dd

Browse files
committed
Fixes
1 parent 6a0be81 commit 429d9dd

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

vignettes/getting-started-with-dockitect.Rmd

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,17 @@ For those new to Docker, here's a quick overview of relevant terms:
3131

3232
You can install the development version of `dockitect` from GitHub:
3333

34-
```{r installation, eval=FALSE}
34+
```{r}
35+
#| label: installation
36+
#| eval: false
3537
# install.packages("remotes")
3638
remotes::install_github("coatless-rpkg/dockitect")
3739
```
3840

3941
Let's start by loading the package:
4042

41-
```{r setup}
43+
```{r}
44+
#| label: setup
4245
library(dockitect)
4346
```
4447

@@ -63,7 +66,8 @@ to it through a series of pipe operations.
6366

6467
Start by creating a new Dockerfile object:
6568

66-
```{r dockerfile-object}
69+
```{r}
70+
#| label: dockerfile-object-init
6771
# Create a new Dockerfile object
6872
df <- dockerfile()
6973
print(df)
@@ -76,10 +80,11 @@ Congratulations! You've created your first (empty) Dockerfile object. Now let's
7680
To add instructions to the Dockerfile, use the `dfi_*()` functions. For example,
7781
to set the base image:
7882

79-
```{r basic-dockerfile}
83+
```{r}
84+
#| label: basic-dockerfile-with-from
8085
# Create a Dockerfile for an R script
8186
df <- dockerfile() |>
82-
dfi_from("rocker/r-ver:4.4.0") |> # Base image with R 4.4.0
87+
dfi_from("rocker/r-ver:4.4.0") # Base image with R 4.4.0
8388
```
8489

8590
You can print the Dockerfile to see the added instruction:
@@ -91,7 +96,8 @@ print(df)
9196
Usually, you'll add multiple instructions to the Dockerfile. Let's add a few more
9297
instructions to the Dockerfile so that we can run a script:
9398

94-
```{r basic-dockerfile}
99+
```{r}
100+
#| label: basic-dockerfile-full
95101
# Create a Dockerfile for an R script
96102
df <- dockerfile() |>
97103
dfi_from("rocker/r-ver:4.4.0") |> # Base image with R 4.4.0
@@ -116,7 +122,8 @@ This example shows the most common Docker instructions:
116122

117123
For `RUN` instructions with multiple commands, you can pass a character vector:
118124

119-
```{r run-multiple}
125+
```{r}
126+
#| label: dockerfile-run-multiple-commands
120127
dockerfile() |>
121128
dfi_from("rocker/r-ver:4.4.0") |>
122129
dfi_run(c(

0 commit comments

Comments
 (0)