dockerContainer-class: docker Class uses the

Description Methods Examples

Description

dockerContainer is a generator object.

Methods

export(Class)

Returns the result of coercing the object to Class. No effect on the object itself.

fsChanges(...)

Inspect changes on containers filesystem.

...:

Additional arguments to pass to httr functions GET, POST etc.

inspect(...)

Return low-level information on the container.

...:

Additional arguments to pass to httr functions GET, POST etc.

kill(...)

Kill the container.

...:

Additional arguments to pass to httr functions GET, POST etc.

listProcesses(ps_args = NULL, ...)

List processes running inside the container.

ps_args:

ps arguments to use (e.g., aux). docker os dependent see https://github.com/docker/docker/issues/8075

...:

Additional arguments to pass to httr functions GET, POST etc.

logs(stdout = FALSE, stderr = FALSE, timestamps = FALSE, tail = "all", ...)

Get stdout and stderr logs from the container.

stdout:

1/True/true or 0/False/false, show stdout log. Default false

stderr:

1/True/true or 0/False/false, show stderr log. Default false

timestamps:

1/True/true or 0/False/false, print timestamps for every log line. Default false

tail:

Output specified number of lines at the end of logs: all or <number>. Default all

...:

Additional arguments to pass to httr functions GET, POST etc.

pause(...)

Pause the container

...:

Additional arguments to pass to httr functions GET, POST etc.

remove(force = FALSE, v = FALSE, ...)

Create an image, either by pulling it from the registry or by importing it.

force:

1/True/true or 0/False/false, default false.

v:

1/True/true or 0/False/false, Remove the volumes associated to the container. Default false

...:

Additional arguments to pass to httr functions GET, POST etc.

resize(height = NULL, width = NULL, ...)

Resize the TTY of the container.

height:

Height for the resized container.

width:

Width for the resized container.

...:

Additional arguments to pass to httr functions GET, POST etc.

restart(t = NULL, ...)

Restart the container.

t:

number of seconds to wait before killing the container.

...:

Additional arguments to pass to httr functions GET, POST etc.

start(Binds = NULL, Links = NULL, LxcConf = NULL, PortBindings = NULL, PublishAllPorts = FALSE, Privileged = FALSE, Dns = NULL, DnsSearch = NULL, VolumesFrom = NULL, CapAdd = NULL, Capdrop = NULL, RestartPolicy = "\"Name\": \"on-failure\"", NetworkMode = "Bridge", Devices = NULL, ...)

Start the container id

Binds:

A list of volume bindings for this container. Each volume binding is a string of the form container_path (to create a new volume for the container), host_path:container_path (to bind-mount a host path into the container), or host_path:container_path:ro (to make the bind-mount read-only inside the container).

Links:

A list of links for the container. Each link entry should be of of the form "container_name:alias"

LxcConf:

LXC specific configurations. These configurations will only work when using the lxc execution driver.

PortBindings:

A map of exposed container ports and the host port they should map to. It should be specified in the form <port>/<protocol>: [ "HostPort": "<port>" ] Take note that port is specified as a string and not an integer value.

PublishAllPorts:

Allocates a random host port for all of a container's exposed ports. Specified as a boolean value.

Privileged:

Gives the container full access to the host. Specified as a boolean value.

Dns:

A list of dns servers for the container to use.

DnsSearch:

A list of DNS search domains

VolumesFrom:

A list of volumes to inherit from another container. Specified in the form <container name>[:<ro|rw>]

CapAdd:

A list of kernel capabilties to add to the container.

Capdrop:

A list of kernel capabilties to drop from the container.

RestartPolicy:

The behavior to apply when the container exits. The value is an object with a Name property of either "always" to always restart or "on-failure" to restart only when the container exit code is non-zero. If on-failure is used, MaximumRetryCount controls the number of times to retry before giving up. The default is not to restart. (optional)

NetworkMode:

Sets the networking mode for the container. Supported values are: bridge, host, and container:<name|id>

Devices:

A list of devices to add to the container specified in the form "PathOnHost": "/dev/deviceName", "PathInContainer": "/dev/deviceName", "CgroupPermissions": "mrw"

...:

Additional arguments to pass to httr functions GET, POST etc.

stop(t = NULL, ...)

Stop the container.

t:

number of seconds to wait before killing the container.

...:

Additional arguments to pass to httr functions GET, POST etc.

unpause(...)

Unpause the container.

...:

Additional arguments to pass to httr functions GET, POST etc.

Examples

1
2
3
4
5
6
7
8
## Not run: 
myConfig <- httr::config(sslcert = "../../certs/cert.pem"
, sslkey = "../../certs/key.pem"
, sslversion=1L, ssl.verifypeer = FALSE)
dckr <- docker("https://192.168.59.103:2376", myConfig)
dckr$getContainers()

## End(Not run)

johndharrison/dockerAPI documentation built on May 19, 2019, 5:13 p.m.