123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- % Generated by roxygen2: do not edit by hand
- % Please edit documentation in R/drender.R
- \name{drender}
- \alias{drender}
- \title{Render Dockerized R Markdown Documents}
- \usage{
- drender(input = NULL, tag = NULL, build_args = NULL,
- container_name = NULL, reset = FALSE, clean = FALSE, cache = TRUE,
- rm = FALSE, prebuild = NULL, port = 80, browseURL = FALSE,
- privileged = TRUE, dind = TRUE, ...)
- }
- \arguments{
- \item{input}{Input file to render in Docker container.}
- \item{tag}{Docker image name to build, sent as docker argument \code{-t}.
- If not specified, it will use the same name as the input file.}
- \item{build_args}{A character string specifying additional
- \code{docker build} arguments. For example,
- \code{--pull=true -m="1024m" --memory-swap="-1"}.}
- \item{container_name}{Docker container name to run.
- If not specified, we will generate and use a random name.}
- \item{reset}{Should we cleanup the Docker container and
- Docker image after getting the rendered result?}
- \item{clean}{default FALSE, if TRUE, clean all containers before build.}
- \item{cache}{default TRUE, if FALSE, build with --no-cache=true}
- \item{rm}{default FALSE, if TRUE build with --rm}
- \item{prebuild}{a command line string to call before docker build}
- \item{port}{default 80 map to shiny's 3838 service}
- \item{browseURL}{FALSE, if TRUE open shiny app in the browser.}
- \item{privileged}{TRUE, with '--privileged=true'}
- \item{dind}{TRUE run with " -v /var/run/docker.sock:/var/run/docker.sock"}
- \item{...}{Additional arguments passed to
- \code{\link[rmarkdown]{render}}.}
- }
- \value{
- Rendered file is written to the same directory of the input file.
- A character vector with the image name and container name will be
- returned. You will be able to manage them with \code{docker}
- commands later if \code{reset = FALSE}.
- }
- \description{
- Render dockerized R Markdown documents using Docker containers.
- Rabix tools/workflows will be ran if there is a \code{Rabixfile}
- generated by \link{lift} under the same directory.
- }
- \details{
- Before using \code{drender()}, run \link{lift} on the document
- first to generate \code{Dockerfile}.
- See \code{vignette('liftr-intro')} for details about the extended
- YAML front-matter metadata format and system requirements for
- rendering dockerized R Markdown documents.
- }
- \examples{
- # 1. Dockerized R Markdown document
- # Docker is required to run the example,
- # so make sure we can use `docker` in shell.
- dir_docker = paste0(tempdir(), '/drender_docker/')
- dir.create(dir_docker)
- file.copy(system.file("examples/docker.Rmd", package = "liftr"), dir_docker)
- docker_input = paste0(dir_docker, "docker.Rmd")
- lift(docker_input)
- \dontrun{
- drender(docker_input)
- # view rendered document
- browseURL(paste0(dir_docker, "docker.html"))}
- # 2. Dockerized R Markdown document with Rabix options
- # Docker and Rabix are required to run the example,
- # so make sure we can use `docker` and `rabix` in shell.
- dir_rabix = paste0(tempdir(), '/drender_rabix/')
- dir.create(dir_rabix)
- file.copy(system.file("template/rabix.Rmd", package = "liftr"), dir_rabix)
- rabix_input = paste0(dir_rabix, "rabix.Rmd")
- lift(rabix_input)
- \dontrun{
- drender(rabix_input)
- # view rendered document
- browseURL(paste0(dir_rabix, "rabix.html"))}
- }
|