containerOpt: Create container options

Description Usage Arguments Examples

View source: R/containerOpt.R

Description

containerOpt A utility function to create options suitable for creating a container.

Usage

1
2
3
4
5
6
7
8
9
containerOpt(Image, Hostname = "", Domainname = "", User = "",
  Memory = 0, MemorySwap = 0, CpuShares = 0, Cpuset = "",
  AttachStdin = FALSE, AttachStdout = TRUE, AttachStderr = TRUE,
  PortSpecs = NA,
  ExposedPorts = HostConfig[["PortBindings"]][["container"]], Tty = FALSE,
  OpenStdin = FALSE, StdinOnce = FALSE, Env = list(), Cmd = NA,
  Volumes = NULL, WorkingDir = "", Entrypoint = NA,
  NetworkDisabled = FALSE, MacAddress = "", OnBuild = NA,
  HostConfig = hostConfig())

Arguments

Image

String value containing the image name to use for the container. Corresponds to docker run IMAGE.

Hostname

A string value containing the desired hostname to use for the container. Corresponds to docker run -h hostname.domain.com.

Domainname

A string value containing the desired domainname to use for the container. Corresponds to docker run -h hostname.domain.com.

Example:

As as example: Hostname = "hostname", Domainname = "domain.com" would correspond to docker run -h hostname.domain.com

User

A string value containg the user to use inside the container. Corresponds to docker run -u

Memory

Memory limit in bytes. Corresponds to docker run -m

MemorySwap

Total memory usage (memory + swap); set -1 to disable swap.

CpuShares

An integer value containing the CPU Shares for container (ie. the relative weight vs othercontainers). Corresponds to docker run -c

Cpuset

String value containg the cgroups Cpuset to use. Corresponds to docker run –cpuset=""

AttachStdin

Boolean value, attaches to stdin. Corresponds to docker run -a stdin

AttachStdout

Boolean value, attaches to stdin. Corresponds to docker run -a stdout

AttachStderr

Boolean value, attaches to stdin. Corresponds to docker run -a stderr

PortSpecs

ADD DOCU

ExposedPorts

An object mapping ports to an empty object in the form of: "ExposedPorts": "<port>/<tcp|udp>: " . See http://stackoverflow.com/questions/20428302/binding-a-port-to-a-host-interface-using-the-rest-api

Tty

Boolean value, Attach standard streams to a tty, including stdin if it is not closed. Corresponds to docker run -t

OpenStdin

Boolean value, opens stdin. Corresponds to docker run -i.

StdinOnce

Boolean value, opens stdin. Corresponds to docker run -i.

Env

A list of environment variables in the form of VAR=value. Corresponds to docker run -e

Example:

As an example: Env = list(MYVAR1=foo1, MYVAR2=foo2) would correspond to docker run -e MYVAR1=foo1 -e MYVAR2=foo2

Cmd

Command to run specified as a string or an array of strings.

Example:

As an example Image = "ubuntu", Cmd = list("/bin/echo","hello","world") would correspond to "docker run ubuntu /bin/echo hello world

Volumes

An object mapping mountpoint paths (strings) inside the container to empty objects.

WorkingDir

A string value containing the working dir for commands to run in. Corresponds to docker run -w

Entrypoint

Set the entrypoint for the container as a string or an array of strings. Corresponds to docker run –entrypoint=""

NetworkDisabled

Boolean value, when true disables neworking for the container. Corresponds to

MacAddress

Container MAC address. Corresponds to docker run –mac-address=...

OnBuild

ADD DOCU

HostConfig

The host configuration. See hostConfig

Examples

1
2
3
4
## Not run: 
containerOpt()

## End(Not run)

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