Skip to content

Commit

Permalink
Add #133
Browse files Browse the repository at this point in the history
  • Loading branch information
chainsawriot committed Apr 15, 2023
1 parent d665fdf commit 798fa5b
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 1 deletion.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ Imports:
Depends:
R (>= 3.5.0)
VignetteBuilder: knitr
LazyData: true
29 changes: 29 additions & 0 deletions R/memo_misc.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,35 @@ NULL
invisible()
}

## data generation
## ---
## recipes <- list()
## recipes["texlive"] <- "## install texlive\nRUN apt-get install -y pandoc pandoc-citeproc texlive"
## recipes["texlivefull"] <- "## install texlive-full\nRUN apt-get install -y pandoc pandoc-citeproc texlive-full"
## recipes["quarto"] <- "## install quarto (latest)\nRUN apt-get install -y curl git && curl -LO https://quarto.org/download/latest/quarto-linux-amd64.deb && dpkg -i quarto-linux-amd64.deb && quarto install tool tinytex && rm quarto-linux-amd64.deb"
## recipes["clean"] <- "## Clean up caches\nRUN rm -rf /var/lib/apt/lists/* && if [ -d \"$CACHE_PATH\" ]; then rm -rf $CACHE_PATH; fi"
## recipes["make"] <- "## install GNU make\nRUN apt-get -y install make"
## usethis::use_data(recipes, overwrite = TRUE)

#' Recipes for Building Container Images
#'
#' A list containing several useful recipes for container building. Useful for the `post_installation_steps` argument of [dockerize()]. Available recipes are:
#' * `texlive`: install pandoc and LaTeX, useful for rendering RMarkdown
#' * `texlivefull`: Similar to the above, but install the full distribution of TeX Live (~ 3GB)
#' * `quarto`: install quarto and tinytex
#' * `clean`: clean up the container image by removing cache
#' * `make`: install GNU make
#' @examples
#' \donttest{
#' if (interactive()) {
#' graph <- resolve(pkgs = c("openNLP", "LDAvis", "topicmodels", "quanteda"),
#' snapshot_date = "2020-01-16")
#' ## install texlive
#' dockerize(graph, ".", post_installation_steps = recipes[['texlive']])
#' }
#' }
"recipes"

## internal data generation
## ---
## ### Supported OS Versions
Expand Down
Binary file added data/recipes.rda
Binary file not shown.
2 changes: 1 addition & 1 deletion inst/update.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ rang <- resolve(here::here(),

## You might want to edit `post_installation_steps` or `cache`
dockerize(rang, output_dir = here::here(), verbose = TRUE, cache = TRUE,
post_installation_steps = c("RUN apt-get install make"),
post_installation_steps = c(recipes[['make']], recipes[['texlive']], recipes[['clean']]),
insert_readme = FALSE,
copy_all = TRUE)
33 changes: 33 additions & 0 deletions man/recipes.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 798fa5b

Please sign in to comment.