R/pull_image.R

Defines functions pull_container

Documented in pull_container

#' Pull a container from dockerhub
#'
#' @inheritParams run
#'
#' @examples
#' if (test_docker_installation()) {
#'   pull_container("alpine")
#' }
#' @export
pull_container <- function(container_id) {
  config <- get_default_config()

  if (config$backend == "docker") {
    processx::run("docker", c("pull", container_id), echo = TRUE)

  } else if (config$backend == "singularity") {
    processx::run("singularity", c("exec", paste0("docker://", container_id), "echo", "hi"), echo_cmd = TRUE, echo = FALSE)
  }

  return(TRUE)
}
dynverse/babelwhale documentation built on Oct. 4, 2019, 12:02 p.m.