R/sp_show_all_docker_containers.R

Defines functions sp_show_all_docker_containers

Documented in sp_show_all_docker_containers

#' Check that docker is running
#'
#' @return 0
#' @export
#'
#' @examples
#' \dontrun{sp_show_all_docker_containers()}
sp_show_all_docker_containers <- function() {
  response <- system2("docker", "ps -a ",
                      stdout = TRUE, stderr = FALSE)
  response_length <- length(response)
  if (response_length == 1) {
    stop("There are no Docker containers running")
  }
  cat(response, sep = "\n")
}
smithjd/sqlpetr documentation built on Feb. 29, 2020, 8:15 p.m.