harbor (version 0.2.0)

docker_cmd: Run a docker command on a host.

Description

Run a docker command on a host.

Usage

docker_cmd(host = harbor::localhost, cmd = NULL, args = NULL,
  docker_opts = NULL, capture_text = FALSE, ...)

# S3 method for localhost docker_cmd(host, cmd = NULL, args = NULL, docker_opts = NULL, capture_text = FALSE, text_from = "stdout", ...)

# S3 method for ssh_host docker_cmd(host, cmd = NULL, args = NULL, docker_opts = NULL, capture_text = FALSE, text_from = "stdout", ...)

Arguments

host

A host object.

cmd

A docker command, such as "run" or "ps"

args

Arguments to pass to the docker command. These are passed in the same way they would need to be passed in to sys::exec_ calls. i.e. "-q -a -s" would be c("-q", "-a", "-s").

docker_opts

Options to docker. These are things that come before the docker command, when run on the command line.

capture_text

If FALSE (the default), return the host object. This is useful for chaining functions. If TRUE``, capture the text output from both stdout and stderr, and return that. Note thatTRUE`` may not be available on all types of hosts.

...

Other arguments passed to the SSH command for the host

text_from

where to capture text from

Examples

Run this code
# NOT RUN {
docker_cmd(localhost, "ps", "-a")
# }

Run the code above in your browser using DataLab