@@ -40,7 +40,7 @@ You can install the development version of `dockitect` from GitHub:
4040remotes::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
104104df <- 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
112112print(df)
@@ -167,7 +167,7 @@ This template creates a basic R environment:
167167#| label: template-base
168168# Create a basic R image
169169df_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)
173173print(df_base)
@@ -181,8 +181,8 @@ For Shiny web applications:
181181#| label: template-shiny
182182# Create a Shiny app image
183183df_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)
188188print(df_shiny)
@@ -224,9 +224,9 @@ di <- dockerignore()
224224
225225# Add patterns to ignore
226226di <- 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
231231print(di)
232232```
0 commit comments