Struct docker_api::container::ContainerOptionsBuilder [−][src]
pub struct ContainerOptionsBuilder { /* fields omitted */ }
Implementations
enable all exposed ports on the container to be mapped to random, available, ports on the host
pub fn expose<P>(
&mut self,
srcport: u32,
protocol: P,
hostport: u32
) -> &mut Self where
P: AsRef<str>,
Publish a port in the container without assigning a port on the host
Specify the working dir (corresponds to the -w
docker cli argument)
Specify any bind mounts, taking the form of /some/host/path:/some/container/path
pub fn links<L, S>(&mut self, links: L) -> &mut Self where
L: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
Total memory limit (memory + swap) in bytes. Set to -1 (default) to enable unlimited swap.
CPU quota in units of 10-9 CPUs. Set to 0 (default) for there to be no limit.
For example, setting nano_cpus
to 500_000_000
results in the container being allocated
50% of a single CPU, while 2_000_000_000
results in the container being allocated 2 CPUs.
CPU quota in units of CPUs. This is a wrapper around nano_cpus
to do the unit conversion.
See nano_cpus
.
Sets an integer value representing the container’s relative CPU weight versus other containers.
pub fn labels<L, K, V>(&mut self, labels: L) -> &mut Self where
L: IntoIterator<Item = (K, V)>,
K: AsRef<str> + Serialize + Eq + Hash,
V: AsRef<str> + Serialize,
Whether to attach to stdin
.
Whether to attach to stdout
.
Whether to attach to stderr
.
Whether standard streams should be attached to a TTY.
pub fn extra_hosts<H, S>(&mut self, extra_hosts: H) -> &mut Self where
H: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
pub fn volumes_from<V, S>(&mut self, volumes_from: V) -> &mut Self where
V: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
pub fn network_mode<M>(&mut self, network_mode: M) -> &mut Self where
M: AsRef<str> + Serialize,
pub fn env<E, S>(&mut self, env: E) -> &mut Self where
E: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
pub fn cmd<C, S>(&mut self, cmd: C) -> &mut Self where
C: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
pub fn entrypoint<E, S>(&mut self, entrypoint: E) -> &mut Self where
E: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
pub fn capabilities<C, S>(&mut self, capabilities: C) -> &mut Self where
C: IntoIterator<Item = S>,
S: AsRef<str> + Serialize,
Signal to stop a container as a string. Default is “SIGTERM”
Signal to stop a container as an integer. Default is 15 (SIGTERM).
Timeout to stop a container. Only seconds are counted. Default is 10s
Trait Implementations
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for ContainerOptionsBuilder
impl Send for ContainerOptionsBuilder
impl Sync for ContainerOptionsBuilder
impl Unpin for ContainerOptionsBuilder
impl UnwindSafe for ContainerOptionsBuilder