sp_docker_run: Run a Docker image

Description Usage Arguments Details Value Examples

View source: R/sp_docker_functions.R

Description

Creates a container and runs an image in it.

Usage

1
sp_docker_run(image_tag, options = "", command = "", args = "")

Arguments

image_tag

character: a valid image tag (name) for the docker image. If it doesn't exist locally, docker run will try to download it. If the download then fails, the function will stop with an error message.

Note that the full syntax of an image tag is <repository>/<name>:<tag>. For example, the PostgreSQL 10 image we use is docker.io/postgres:10.

options

character: the options to use when running the image. Default is the empty string. You will usually need at least the --name option to give the container a name.

command

character: the command to run after the container boots up. Default is an empty string, which uses the startup command defined in the image.

args

character: the arguments for the command. Default is an empty string.

Details

Do docker run --help in a command prompt to see all the options, of which there are many.

Value

Result of Docker command if it succeeded. Stops with an error message if it failed.

Examples

1
2
3
4
5
## Not run: 
print(sp_docker_run("hello-world"))
sp_docker_images_tibble()

## End(Not run)

smithjd/sqlpetr documentation built on Feb. 29, 2020, 8:15 p.m.