diff --git a/NAMESPACE b/NAMESPACE index b0d7967..a3dd399 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,5 +1,6 @@ # Generated by roxygen2: do not edit by hand +export("%|0|%") export(Dockerfile) export(dock_from_desc) export(dock_from_renv) diff --git a/R/dock_from_desc.R b/R/dock_from_desc.R index c5c785f..a663bcf 100644 --- a/R/dock_from_desc.R +++ b/R/dock_from_desc.R @@ -36,7 +36,9 @@ base_pkg_ <- c( #' @param FROM The FROM of the Dockerfile. Default is #' FROM rocker/r-ver:`R.Version()$major`.`R.Version()$minor`. #' @param AS The AS of the Dockerfile. Default it NULL. +#' @param sha256 character. The Digest SHA256 hash corresponding to the chip architecture of the deployment host machine. This will need to be set in instances where the machine on which the image is built is different than the machine on which the image will be hosted/deployed. This is a convenience for setting `FROM = rocker/rver@sha256:xxxx` #' @param sysreqs boolean. If TRUE, the Dockerfile will contain sysreq installation. +#' @param use_suggests boolean. If TRUE (the default), include dependencies listed in Suggests field in DESCRIPTION. #' @param repos character. The URL(s) of the repositories to use for `options("repos")`. #' @param expand boolean. If `TRUE` each system requirement will have its own `RUN` line. #' @param build_from_source boolean. If `TRUE` no tar.gz is created and @@ -64,7 +66,9 @@ dock_from_desc <- function( ".", R.Version()$minor ), + sha256 = NULL, AS = NULL, + use_suggests = TRUE, sysreqs = TRUE, repos = c(CRAN = "https://cran.rstudio.com/"), expand = FALSE, @@ -74,7 +78,10 @@ dock_from_desc <- function( ) { path <- fs::path_abs(path) - packages <- desc_get_deps(path)$package + packages <- desc_get_deps(path) + if (!use_suggests) + packages <- packages[packages$type != "Suggests",] + packages <- packages$package packages <- packages[packages != "R"] # remove R packages <- packages[!packages %in% base_pkg_] # remove base and recommended @@ -127,10 +134,10 @@ dock_from_desc <- function( packages ) - packages_not_on_cran <- setdiff( + packages_not_on_cran <- sort(setdiff( packages, packages_on_cran - ) + )) packages_with_version <- data.frame( package = remotes_deps$package, @@ -146,6 +153,11 @@ dock_from_desc <- function( packages_with_version$package ) + packages_on_cran <- packages_on_cran[order(names(packages_on_cran))] + # Add SHA for Architecture + if (!is.null(sha256)) + FROM <- paste0(FROM, "@sha256:", sha256) + dock <- Dockerfile$new( FROM = FROM, AS = AS @@ -206,7 +218,7 @@ dock_from_desc <- function( } if (length(packages_not_on_cran > 0)) { - nn <- as.data.frame( + nn_df <- as.data.frame( do.call( rbind, lapply( @@ -218,26 +230,46 @@ dock_from_desc <- function( ) ) + nn <- sprintf( + "%s/%s", + nn_df$username, + nn_df$repo + ) + + repo_status <- lapply(nn, repo_get) + ind_private <- sapply(repo_status, function(x) x$visibility == "private") %|0|% FALSE + if (any(ind_private)) { + dock$ARG("GITHUB_PAT") + dock$RUN("GITHUB_PAT=$GITHUB_PAT") + } + + nn <- sprintf( "%s/%s@%s", - nn$username, - nn$repo, - nn$sha + nn_df$username, + nn_df$repo, + nn_df$sha ) pong <- mapply( - function(dock, ver, nm) { + function(dock, ver, nm, i) { + fmt <- "Rscript -e 'remotes::install_github(\"%s\")'" + if (i) + fmt <- paste("GITHUB_PAT=$GITHUB_PAT", fmt) res <- dock$RUN( sprintf( - "Rscript -e 'remotes::install_github(\"%s\")'", + fmt, ver ) ) }, ver = nn, + i = ind_private, MoreArgs = list(dock = dock) ) + cat_red_bullet(glue::glue("Must add `--build-arg GITHUB_PAT={remotes:::github_pat()}` to `docker build` call. Note that the GITHUB_PAT will be visible in this image metadata. If uploaded to Docker Hub, the visibility must be set to private to avoid exposing the GITHUB_PAT.")) + dock$custom("#", "Must add `--build-arg GITHUB_PAT=[YOUR GITHUB PAT]` to `docker build` call") } if (!build_from_source) { @@ -303,7 +335,10 @@ dock_from_desc <- function( dock$RUN("mkdir /build_zone") dock$ADD(from = ".", to = "/build_zone") dock$WORKDIR("/build_zone") - dock$RUN("R -e 'remotes::install_local(upgrade=\"never\")'") + run <- "R -e 'remotes::install_local(upgrade=\"never\")'" + if (any(get0("ind_private", inherits = FALSE))) + run <- paste("GITHUB_PAT=$GITHUB_PAT", run) + dock$RUN(run) dock$RUN("rm -rf /build_zone") } # Add a dockerignore @@ -331,3 +366,25 @@ repos_as_character <- function(repos) { repos_as_character } + +#' @noRd +repo_get <- function(repo) { + jsonlite::fromJSON(suppressMessages(system(glue::glue("curl -H \"Accept: application/vnd.github+json\" -H \"Authorization: token {remotes:::github_pat()}\" https://api.github.com/repos/{repo}"), intern = TRUE))) +} + +#' Replace zero-length values in a vector +#' @rdname op-zero-default +#' @param x \code{vctr} +#' @param y \code{object} to replace zero-length values. Must be of same class as x +#' +#' @return \code{vctr} +#' @export +#' +#' @examples +#' c(TRUE, FALSE, logical(0)) %|0|% FALSE +`%|0|%` <- Vectorize(function(x, y) { + if (rlang::is_empty(x)) + y + else + x +}) diff --git a/R/dock_from_renv.R b/R/dock_from_renv.R index a77d0a6..ad23508 100644 --- a/R/dock_from_renv.R +++ b/R/dock_from_renv.R @@ -13,6 +13,7 @@ available_distros <- c( #' @param FROM Docker image to start FROM Default is #' FROM rocker/r-base #' @param AS The AS of the Dockerfile. Default it NULL. +#' @param sha256 character. The Digest SHA256 hash corresponding to the chip architecture of the deployment host machine. This will need to be set in instances where the machine on which the image is built is different than the machine on which the image will be hosted/deployed. This is a convenience for setting `FROM = rocker/rver@sha256:xxxx` #' @param distro One of "focal", "bionic", "xenial", "centos7", #' or "centos8". See available distributions #' at https://hub.docker.com/r/rstudio/r-base/. @@ -48,6 +49,7 @@ dock_from_renv <- function( lockfile = "renv.lock", distro = "focal", FROM = "rocker/r-base", + sha256 = NULL, AS = NULL, sysreqs = TRUE, repos = c(CRAN = "https://cran.rstudio.com/"), @@ -61,6 +63,9 @@ dock_from_renv <- function( # lock$repos(CRAN = repos) lockfile <- basename(lockfile) + # Add SHA for Architecture + if (!is.null(sha256)) + FROM <- paste0(FROM, "@sha256:", sha256) # start the dockerfile R_major_minor <- lock$data()$R$Version dock <- Dockerfile$new( diff --git a/man/Dockerfile.Rd b/man/Dockerfile.Rd index 90bf687..1964c52 100644 --- a/man/Dockerfile.Rd +++ b/man/Dockerfile.Rd @@ -46,36 +46,36 @@ my_dock <- Dockerfile$new() \section{Methods}{ \subsection{Public methods}{ \itemize{ -\item \href{#method-new}{\code{Dockerfile$new()}} -\item \href{#method-RUN}{\code{Dockerfile$RUN()}} -\item \href{#method-ADD}{\code{Dockerfile$ADD()}} -\item \href{#method-COPY}{\code{Dockerfile$COPY()}} -\item \href{#method-WORKDIR}{\code{Dockerfile$WORKDIR()}} -\item \href{#method-EXPOSE}{\code{Dockerfile$EXPOSE()}} -\item \href{#method-VOLUME}{\code{Dockerfile$VOLUME()}} -\item \href{#method-CMD}{\code{Dockerfile$CMD()}} -\item \href{#method-LABEL}{\code{Dockerfile$LABEL()}} -\item \href{#method-ENV}{\code{Dockerfile$ENV()}} -\item \href{#method-ENTRYPOINT}{\code{Dockerfile$ENTRYPOINT()}} -\item \href{#method-USER}{\code{Dockerfile$USER()}} -\item \href{#method-ARG}{\code{Dockerfile$ARG()}} -\item \href{#method-ONBUILD}{\code{Dockerfile$ONBUILD()}} -\item \href{#method-STOPSIGNAL}{\code{Dockerfile$STOPSIGNAL()}} -\item \href{#method-HEALTHCHECK}{\code{Dockerfile$HEALTHCHECK()}} -\item \href{#method-SHELL}{\code{Dockerfile$SHELL()}} -\item \href{#method-MAINTAINER}{\code{Dockerfile$MAINTAINER()}} -\item \href{#method-custom}{\code{Dockerfile$custom()}} -\item \href{#method-print}{\code{Dockerfile$print()}} -\item \href{#method-write}{\code{Dockerfile$write()}} -\item \href{#method-switch_cmd}{\code{Dockerfile$switch_cmd()}} -\item \href{#method-remove_cmd}{\code{Dockerfile$remove_cmd()}} -\item \href{#method-add_after}{\code{Dockerfile$add_after()}} -\item \href{#method-clone}{\code{Dockerfile$clone()}} +\item \href{#method-Dockerfile-new}{\code{Dockerfile$new()}} +\item \href{#method-Dockerfile-RUN}{\code{Dockerfile$RUN()}} +\item \href{#method-Dockerfile-ADD}{\code{Dockerfile$ADD()}} +\item \href{#method-Dockerfile-COPY}{\code{Dockerfile$COPY()}} +\item \href{#method-Dockerfile-WORKDIR}{\code{Dockerfile$WORKDIR()}} +\item \href{#method-Dockerfile-EXPOSE}{\code{Dockerfile$EXPOSE()}} +\item \href{#method-Dockerfile-VOLUME}{\code{Dockerfile$VOLUME()}} +\item \href{#method-Dockerfile-CMD}{\code{Dockerfile$CMD()}} +\item \href{#method-Dockerfile-LABEL}{\code{Dockerfile$LABEL()}} +\item \href{#method-Dockerfile-ENV}{\code{Dockerfile$ENV()}} +\item \href{#method-Dockerfile-ENTRYPOINT}{\code{Dockerfile$ENTRYPOINT()}} +\item \href{#method-Dockerfile-USER}{\code{Dockerfile$USER()}} +\item \href{#method-Dockerfile-ARG}{\code{Dockerfile$ARG()}} +\item \href{#method-Dockerfile-ONBUILD}{\code{Dockerfile$ONBUILD()}} +\item \href{#method-Dockerfile-STOPSIGNAL}{\code{Dockerfile$STOPSIGNAL()}} +\item \href{#method-Dockerfile-HEALTHCHECK}{\code{Dockerfile$HEALTHCHECK()}} +\item \href{#method-Dockerfile-SHELL}{\code{Dockerfile$SHELL()}} +\item \href{#method-Dockerfile-MAINTAINER}{\code{Dockerfile$MAINTAINER()}} +\item \href{#method-Dockerfile-custom}{\code{Dockerfile$custom()}} +\item \href{#method-Dockerfile-print}{\code{Dockerfile$print()}} +\item \href{#method-Dockerfile-write}{\code{Dockerfile$write()}} +\item \href{#method-Dockerfile-switch_cmd}{\code{Dockerfile$switch_cmd()}} +\item \href{#method-Dockerfile-remove_cmd}{\code{Dockerfile$remove_cmd()}} +\item \href{#method-Dockerfile-add_after}{\code{Dockerfile$add_after()}} +\item \href{#method-Dockerfile-clone}{\code{Dockerfile$clone()}} } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-new}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Dockerfile-new}{}}} \subsection{Method \code{new()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Dockerfile$new(FROM = "rocker/r-base", AS = NULL)}\if{html}{\out{
}} @@ -83,8 +83,8 @@ my_dock <- Dockerfile$new() } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-RUN}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Dockerfile-RUN}{}}} \subsection{Method \code{RUN()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Dockerfile$RUN(cmd)}\if{html}{\out{
}} @@ -92,8 +92,8 @@ my_dock <- Dockerfile$new() } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-ADD}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Dockerfile-ADD}{}}} \subsection{Method \code{ADD()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Dockerfile$ADD(from, to, force = TRUE)}\if{html}{\out{
}} @@ -101,8 +101,8 @@ my_dock <- Dockerfile$new() } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-COPY}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Dockerfile-COPY}{}}} \subsection{Method \code{COPY()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Dockerfile$COPY(from, to, force = TRUE)}\if{html}{\out{
}} @@ -110,8 +110,8 @@ my_dock <- Dockerfile$new() } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-WORKDIR}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Dockerfile-WORKDIR}{}}} \subsection{Method \code{WORKDIR()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Dockerfile$WORKDIR(where)}\if{html}{\out{
}} @@ -119,8 +119,8 @@ my_dock <- Dockerfile$new() } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-EXPOSE}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Dockerfile-EXPOSE}{}}} \subsection{Method \code{EXPOSE()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Dockerfile$EXPOSE(port)}\if{html}{\out{
}} @@ -128,8 +128,8 @@ my_dock <- Dockerfile$new() } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-VOLUME}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Dockerfile-VOLUME}{}}} \subsection{Method \code{VOLUME()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Dockerfile$VOLUME(volume)}\if{html}{\out{
}} @@ -137,8 +137,8 @@ my_dock <- Dockerfile$new() } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-CMD}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Dockerfile-CMD}{}}} \subsection{Method \code{CMD()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Dockerfile$CMD(cmd)}\if{html}{\out{
}} @@ -146,8 +146,8 @@ my_dock <- Dockerfile$new() } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-LABEL}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Dockerfile-LABEL}{}}} \subsection{Method \code{LABEL()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Dockerfile$LABEL(key, value)}\if{html}{\out{
}} @@ -155,8 +155,8 @@ my_dock <- Dockerfile$new() } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-ENV}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Dockerfile-ENV}{}}} \subsection{Method \code{ENV()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Dockerfile$ENV(key, value)}\if{html}{\out{
}} @@ -164,8 +164,8 @@ my_dock <- Dockerfile$new() } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-ENTRYPOINT}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Dockerfile-ENTRYPOINT}{}}} \subsection{Method \code{ENTRYPOINT()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Dockerfile$ENTRYPOINT(cmd)}\if{html}{\out{
}} @@ -173,8 +173,8 @@ my_dock <- Dockerfile$new() } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-USER}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Dockerfile-USER}{}}} \subsection{Method \code{USER()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Dockerfile$USER(user)}\if{html}{\out{
}} @@ -182,8 +182,8 @@ my_dock <- Dockerfile$new() } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-ARG}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Dockerfile-ARG}{}}} \subsection{Method \code{ARG()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Dockerfile$ARG(arg, ahead = FALSE)}\if{html}{\out{
}} @@ -191,8 +191,8 @@ my_dock <- Dockerfile$new() } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-ONBUILD}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Dockerfile-ONBUILD}{}}} \subsection{Method \code{ONBUILD()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Dockerfile$ONBUILD(cmd)}\if{html}{\out{
}} @@ -200,8 +200,8 @@ my_dock <- Dockerfile$new() } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-STOPSIGNAL}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Dockerfile-STOPSIGNAL}{}}} \subsection{Method \code{STOPSIGNAL()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Dockerfile$STOPSIGNAL(signal)}\if{html}{\out{
}} @@ -209,8 +209,8 @@ my_dock <- Dockerfile$new() } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-HEALTHCHECK}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Dockerfile-HEALTHCHECK}{}}} \subsection{Method \code{HEALTHCHECK()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Dockerfile$HEALTHCHECK(check)}\if{html}{\out{
}} @@ -218,8 +218,8 @@ my_dock <- Dockerfile$new() } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-SHELL}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Dockerfile-SHELL}{}}} \subsection{Method \code{SHELL()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Dockerfile$SHELL(shell)}\if{html}{\out{
}} @@ -227,8 +227,8 @@ my_dock <- Dockerfile$new() } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-MAINTAINER}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Dockerfile-MAINTAINER}{}}} \subsection{Method \code{MAINTAINER()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Dockerfile$MAINTAINER(name, email)}\if{html}{\out{
}} @@ -236,8 +236,8 @@ my_dock <- Dockerfile$new() } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-custom}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Dockerfile-custom}{}}} \subsection{Method \code{custom()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Dockerfile$custom(base, cmd)}\if{html}{\out{
}} @@ -245,8 +245,8 @@ my_dock <- Dockerfile$new() } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-print}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Dockerfile-print}{}}} \subsection{Method \code{print()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Dockerfile$print()}\if{html}{\out{
}} @@ -254,8 +254,8 @@ my_dock <- Dockerfile$new() } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-write}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Dockerfile-write}{}}} \subsection{Method \code{write()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Dockerfile$write(as = "Dockerfile")}\if{html}{\out{
}} @@ -263,8 +263,8 @@ my_dock <- Dockerfile$new() } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-switch_cmd}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Dockerfile-switch_cmd}{}}} \subsection{Method \code{switch_cmd()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Dockerfile$switch_cmd(a, b)}\if{html}{\out{
}} @@ -272,8 +272,8 @@ my_dock <- Dockerfile$new() } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-remove_cmd}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Dockerfile-remove_cmd}{}}} \subsection{Method \code{remove_cmd()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Dockerfile$remove_cmd(where)}\if{html}{\out{
}} @@ -281,8 +281,8 @@ my_dock <- Dockerfile$new() } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-add_after}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Dockerfile-add_after}{}}} \subsection{Method \code{add_after()}}{ \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Dockerfile$add_after(cmd, after)}\if{html}{\out{
}} @@ -290,8 +290,8 @@ my_dock <- Dockerfile$new() } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-clone}{}}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-Dockerfile-clone}{}}} \subsection{Method \code{clone()}}{ The objects of this class are cloneable with this method. \subsection{Usage}{ diff --git a/man/dock_from_renv.Rd b/man/dock_from_renv.Rd index 1b02558..ed07f53 100644 --- a/man/dock_from_renv.Rd +++ b/man/dock_from_renv.Rd @@ -8,6 +8,7 @@ dock_from_renv( lockfile = "renv.lock", distro = "focal", FROM = "rocker/r-base", + sha256 = NULL, AS = NULL, sysreqs = TRUE, repos = c(CRAN = "https://cran.rstudio.com/"), @@ -25,6 +26,8 @@ at https://hub.docker.com/r/rstudio/r-base/.} \item{FROM}{Docker image to start FROM Default is FROM rocker/r-base} +\item{sha256}{character. The Digest SHA256 hash corresponding to the chip architecture of the deployment host machine. This will need to be set in instances where the machine on which the image is built is different than the machine on which the image will be hosted/deployed. This is a convenience for setting `FROM = rocker/rver@sha256:xxxx`} + \item{AS}{The AS of the Dockerfile. Default it NULL.} \item{sysreqs}{boolean. If `TRUE`, the Dockerfile diff --git a/man/dockerfiles.Rd b/man/dockerfiles.Rd index 413d3d3..38cdddb 100644 --- a/man/dockerfiles.Rd +++ b/man/dockerfiles.Rd @@ -7,7 +7,9 @@ dock_from_desc( path = "DESCRIPTION", FROM = paste0("rocker/r-ver:", R.Version()$major, ".", R.Version()$minor), + sha256 = NULL, AS = NULL, + use_suggests = TRUE, sysreqs = TRUE, repos = c(CRAN = "https://cran.rstudio.com/"), expand = FALSE, @@ -22,8 +24,12 @@ dock_from_desc( \item{FROM}{The FROM of the Dockerfile. Default is FROM rocker/r-ver:`R.Version()$major`.`R.Version()$minor`.} +\item{sha256}{character. The Digest SHA256 hash corresponding to the chip architecture of the deployment host machine. This will need to be set in instances where the machine on which the image is built is different than the machine on which the image will be hosted/deployed. This is a convenience for setting `FROM = rocker/rver@sha256:xxxx`} + \item{AS}{The AS of the Dockerfile. Default it NULL.} +\item{use_suggests}{boolean. If TRUE (the default), include dependencies listed in Suggests field in DESCRIPTION.} + \item{sysreqs}{boolean. If TRUE, the Dockerfile will contain sysreq installation.} \item{repos}{character. The URL(s) of the repositories to use for `options("repos")`.} diff --git a/man/op-zero-default.Rd b/man/op-zero-default.Rd new file mode 100644 index 0000000..3611ba4 --- /dev/null +++ b/man/op-zero-default.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/dock_from_desc.R +\name{\%|0|\%} +\alias{\%|0|\%} +\title{Replace zero-length values in a vector} +\usage{ +x \%|0|\% y +} +\arguments{ +\item{x}{\code{vctr}} + +\item{y}{\code{object} to replace zero-length values. Must be of same class as x} +} +\value{ +\code{vctr} +} +\description{ +Replace zero-length values in a vector +} +\examples{ +c(TRUE, FALSE, logical(0)) \%|0|\% FALSE +}