Browse Source

Tweaks to docker functions

master
boB Rudis 3 years ago
parent
commit
a9d3880dac
4 changed files with 22 additions and 8 deletions
  1. +8
    -4
      R/docker.r
  2. +5
    -2
      man/install_splash.Rd
  3. +4
    -1
      man/start_splash.Rd
  4. +5
    -1
      man/stop_splash.Rd

+ 8
- 4
R/docker.r View File

@@ -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


+ 5
- 2
man/install_splash.Rd View File

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


+ 4
- 1
man/start_splash.Rd View File

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


+ 5
- 1
man/stop_splash.Rd View File

@@ -4,9 +4,13 @@
\alias{stop_splash}
\title{Stop a running a Splash server Docker container}
\usage{
stop_splash(splash_container)
stop_splash(splash_container, host = harbor::localhost)
}
\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]}
}
\description{


Loading…
Cancel
Save