Browse Source

Tweaks to docker functions

master
boB Rudis 7 years ago
parent
commit
a9d3880dac
  1. 12
      R/docker.r
  2. 7
      man/install_splash.Rd
  3. 5
      man/start_splash.Rd
  4. 6
      man/stop_splash.Rd

12
R/docker.r

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

7
man/install_splash.Rd

@ -4,10 +4,13 @@
\alias{install_splash} \alias{install_splash}
\title{Retrieve the Docker image for Splash} \title{Retrieve the Docker image for Splash}
\usage{ \usage{
install_splash() install_splash(host = harbor::localhost)
}
\arguments{
\item{host}{Docker host; defauolts to \code{localhost}}
} }
\value{ \value{
`harbor` `host` object \code{harbor} \code{host} object
} }
\description{ \description{
Retrieve the Docker image for Splash Retrieve the Docker image for Splash

5
man/start_splash.Rd

@ -4,7 +4,10 @@
\alias{start_splash} \alias{start_splash}
\title{Start a Splash server Docker container} \title{Start a Splash server Docker container}
\usage{ \usage{
start_splash() start_splash(host = harbor::localhost)
}
\arguments{
\item{host}{Docker host; defauolts to `localhost`}
} }
\value{ \value{
`harbor` `container` object `harbor` `container` object

6
man/stop_splash.Rd

@ -4,9 +4,13 @@
\alias{stop_splash} \alias{stop_splash}
\title{Stop a running a Splash server Docker container} \title{Stop a running a Splash server Docker container}
\usage{ \usage{
stop_splash(splash_container) stop_splash(splash_container, host = harbor::localhost)
} }
\arguments{ \arguments{
\item{splash_container}{saved Splash container id from [start_splash]}
\item{host}{Docker host; defauolts to `localhost`}
\item{splash_container}{Docker `container` object created by [start_splash]} \item{splash_container}{Docker `container` object created by [start_splash]}
} }
\description{ \description{

Loading…
Cancel
Save