|
|
@ -1,5 +1,7 @@ |
|
|
|
#' Retrieve the Docker image for Splash |
|
|
|
#' |
|
|
|
#' @md |
|
|
|
#' @param host Docker host; defauolts to `localhost` |
|
|
|
#' @return `harbor` `host` object |
|
|
|
#' @export |
|
|
|
#' @examples \dontrun{ |
|
|
@ -7,12 +9,13 @@ |
|
|
|
#' splash_container <- start_splash() |
|
|
|
#' stop_splash(splash_container) |
|
|
|
#' } |
|
|
|
install_splash <- function() { |
|
|
|
harbor::docker_pull(localhost, "scrapinghub/splash") |
|
|
|
install_splash <- function(host = harbor::localhost) { |
|
|
|
harbor::docker_pull(host, "scrapinghub/splash") |
|
|
|
} |
|
|
|
|
|
|
|
#' Start a Splash server Docker container |
|
|
|
#' |
|
|
|
#' @param host Docker host; defauolts to `localhost` |
|
|
|
#' @note you need Docker running on your system and have pulled the container with |
|
|
|
#' [install_spash] for this to work. You should save the resultant `host` |
|
|
|
#' object for use in [stop_splash]. |
|
|
@ -23,13 +26,14 @@ install_splash <- function() { |
|
|
|
#' splash_container <- start_splash() |
|
|
|
#' stop_splash(splash_container) |
|
|
|
#' } |
|
|
|
start_splash <- function() { |
|
|
|
harbor::docker_run(localhost, image = "scrapinghub/splash", detach = TRUE, |
|
|
|
start_splash <- function(host = harbor::localhost) { |
|
|
|
harbor::docker_run(host, image = "scrapinghub/splash", detach = TRUE, |
|
|
|
docker_opts = "-p 5023:5023 -p 8050:8050 -p 8051:8051") |
|
|
|
} |
|
|
|
|
|
|
|
#' Stop a running a Splash server Docker container |
|
|
|
#' |
|
|
|
#' @param splash_container saved Splash container id from [start_splash] |
|
|
|
#' @param splash_container Docker `container` object created by [start_splash] |
|
|
|
#' @note you need Docker running on your system and have pulled the container with |
|
|
|
#' [install_spash] and started the Splash container with [start_splash] for this |
|
|
|