Skip to content

Commit 7076d2f

Browse files
committed
Tweaks
1 parent abbac33 commit 7076d2f

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

README.Rmd

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ df <- read_dockerfile("path/to/Dockerfile")
151151
152152
# Modify it
153153
df |>
154-
dfm_add_line("RUN echo 'Hello World'", after = 3) |> # Add a line after line 3
155154
dfm_remove_line(5) |> # Remove line 5
156155
dfm_group_similar() |> # Group similar commands (e.g., RUN)
157156
write_dockerfile("Dockerfile.new") # Write to a new file
@@ -169,8 +168,8 @@ create and maintain a `.dockerignore` file through `dockerignore()`.
169168
#| eval: false
170169
# Create a .dockerignore file with common patterns
171170
dockerignore() |>
172-
di_add_common(include_git = TRUE, include_r = TRUE) |> # Add common patterns for Git and R
173-
di_add("*.log") |> # Add custom patterns
171+
dk_template_ignore_common(git = TRUE, r = TRUE) |> # Add common patterns for Git and R
172+
di_add("*.log") |> # Add custom patterns
174173
di_add("output/") |>
175174
write_dockerignore()
176175
```

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ df <- read_dockerfile("path/to/Dockerfile")
136136

137137
# Modify it
138138
df |>
139-
dfm_add_line("RUN echo 'Hello World'", after = 3) |> # Add a line after line 3
140139
dfm_remove_line(5) |> # Remove line 5
141140
dfm_group_similar() |> # Group similar commands (e.g., RUN)
142141
write_dockerfile("Dockerfile.new") # Write to a new file
@@ -153,8 +152,8 @@ through `dockerignore()`.
153152
``` r
154153
# Create a .dockerignore file with common patterns
155154
dockerignore() |>
156-
di_add_common(include_git = TRUE, include_r = TRUE) |> # Add common patterns for Git and R
157-
di_add("*.log") |> # Add custom patterns
155+
dk_template_ignore_common(git = TRUE, r = TRUE) |> # Add common patterns for Git and R
156+
di_add("*.log") |> # Add custom patterns
158157
di_add("output/") |>
159158
write_dockerignore()
160159
```

vignettes/getting-started-with-dockitect.Rmd

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ You can install the development version of `dockitect` from GitHub:
4040
remotes::install_github("coatless-rpkg/dockitect")
4141
```
4242

43-
Let's start by loading the package:
43+
Access the package by loading it:
4444

4545
```{r}
4646
#| label: setup
@@ -102,11 +102,11 @@ instructions to the Dockerfile so that we can run a script:
102102
#| label: basic-dockerfile-full
103103
# Create a Dockerfile for an R script
104104
df <- dockerfile() |>
105-
dfi_from("rocker/r-ver:4.4.0") |> # Base image with R 4.4.0
105+
dfi_from("rocker/r-ver:4.4.0") |> # Base image with R 4.4.0
106106
dfi_label(maintainer = "[email protected]") |> # Add metadata
107-
dfi_workdir("/app") |> # Set working directory
107+
dfi_workdir("/app") |> # Set working directory
108108
dfi_copy("analysis.R", "/app/") |> # Copy R script to container
109-
dfi_cmd("Rscript analysis.R") # Command to run when container starts
109+
dfi_cmd("Rscript /app/analysis.R") # Command to run when container starts
110110
111111
# Print the Dockerfile
112112
print(df)
@@ -167,7 +167,7 @@ This template creates a basic R environment:
167167
#| label: template-base
168168
# Create a basic R image
169169
df_base <- dk_template_base(
170-
r_version = "4.4.0", # Specify R version
170+
r_version = "4.4.0", # Specify R version
171171
additional_pkgs = c("dplyr", "ggplot2") # Add R packages
172172
)
173173
print(df_base)
@@ -181,8 +181,8 @@ For Shiny web applications:
181181
#| label: template-shiny
182182
# Create a Shiny app image
183183
df_shiny <- dk_template_shiny(
184-
r_version = "4.4.0", # Specify R version
185-
port = 3838, # Port for Shiny server
184+
r_version = "4.4.0", # Specify R version
185+
port = 3838, # Port for Shiny server
186186
additional_pkgs = c("dplyr", "ggplot2") # Add R packages
187187
)
188188
print(df_shiny)
@@ -224,9 +224,9 @@ di <- dockerignore()
224224
225225
# Add patterns to ignore
226226
di <- di |>
227-
di_add(".git/") |> # Ignore Git directory
228-
di_add("*.Rdata") |> # Ignore R data files
229-
di_add("data/*.csv") # Ignore CSV files in data directory
227+
di_add("*.Rdata") |> # Ignore R data files
228+
di_add("data/*.csv") |> # Ignore CSV files in data directory
229+
dk_template_ignore_git() # Add common Git patterns
230230
231231
print(di)
232232
```

0 commit comments

Comments
 (0)