Skip to main content

DockerContainerConfig

Struct DockerContainerConfig 

Source
pub struct DockerContainerConfig { /* private fields */ }
Expand description

Every optional field left out is not managed (no regent’s defaults here, only docker’s)

Implementations§

Source§

impl DockerContainerConfig

Source

pub fn new(image: ContainerImage) -> Self

Source

pub fn with_pull_policy(self, pull: PullPolicy) -> Self

Source

pub fn with_pull_if_missing(self) -> Self

Pull the image only if it is not present on the host (default, PullPolicy::Missing)

Source

pub fn with_pull_never(self) -> Self

Never pull the image: a missing image makes the attribute non-compliant (PullPolicy::Never)

Source

pub fn with_command(self, command: ContainerCommand) -> Self

Source

pub fn with_entrypoint(self, entrypoint: &str) -> Self

Source

pub fn with_env(self, key: EnvVarName, value: Parameter<String>) -> Self

Source

pub fn with_volumes(self, volumes: Vec<ContainerVolume>) -> Self

Source

pub fn with_networking(self, networking: DockerNetworking) -> Self

Source

pub fn with_host_networking(self) -> Self

Share the host network stack (--network host). Replaces the networks and published ports set before.

Source

pub fn with_isolated_networking(self) -> Self

No network at all (--network none). Replaces the networks and published ports set before.

Source

pub fn with_network(self, network: NetworkName) -> Self

Attach the container to a network, after the networks added before (the first one is used at creation). Replaces Host or Isolated networking.

Source

pub fn with_published_port(self, port: PublishedPort) -> Self

Publish a port, in addition to the ports published before. Ports can only be published on attached networking: replaces Host or Isolated networking.

Source

pub fn with_restart_policy(self, restart_policy: RestartPolicy) -> Self

Source

pub fn with_restart_never(self) -> Self

Never restart the container (--restart no)

Source

pub fn with_restart_always(self) -> Self

Always restart the container (--restart always)

Source

pub fn with_restart_unless_stopped(self) -> Self

Restart the container unless it was stopped (--restart unless-stopped)

Source

pub fn with_restart_on_failure(self, max_retries: u32) -> Self

Restart the container when it fails, at most max_retries times (0 means unlimited, --restart on-failure[:max-retries])

Source

pub fn with_hostname(self, hostname: &str) -> Self

Source

pub fn with_user(self, user: &str) -> Self

Source

pub fn with_working_dir(self, working_dir: &str) -> Self

Source

pub fn with_label(self, key: &str, value: &str) -> Self

Source

pub fn with_privileged(self, privileged: bool) -> Self

Source

pub fn with_read_only(self, read_only: bool) -> Self

Source

pub fn with_init(self, init: bool) -> Self

Source

pub fn with_cap_add(self, capabilities: Vec<Capability>) -> Self

Source

pub fn with_cap_drop(self, capabilities: Vec<Capability>) -> Self

Source

pub fn with_memory(self, memory: MemorySize) -> Self

Source

pub fn with_cpus(self, cpus: CpuCount) -> Self

Source

pub fn with_extra_hosts(self, extra_hosts: Vec<ExtraHost>) -> Self

Source

pub fn with_dns(self, dns: Vec<IpAddr>) -> Self

Source

pub fn with_devices(self, devices: Vec<HostDevice>) -> Self

Source

pub fn with_gpus(self, gpus: GpuSelection) -> Self

Source

pub fn with_all_gpus(self) -> Self

Give all the GPUs to the container (--gpus all). Replaces the devices added before.

Source

pub fn with_gpu_device(self, gpu: GpuId) -> Self

Give a GPU to the container, in addition to the devices added before. Replaces with_all_gpus().

Source

pub fn with_ipc(self, ipc: IpcNamespace) -> Self

Source

pub fn with_host_ipc(self) -> Self

Share the host IPC namespace and /dev/shm (--ipc host). Replaces a private namespace and its /dev/shm size.

Source

pub fn with_private_ipc(self) -> Self

Own IPC namespace (--ipc private). Replaces the host namespace, keeps the /dev/shm size set before.

Source

pub fn with_shareable_ipc(self) -> Self

Own IPC namespace which other containers can join (--ipc shareable). Replaces the host namespace, keeps the /dev/shm size set before.

Source

pub fn with_shm_size(self, shm_size: MemorySize) -> Self

Size of /dev/shm (--shm-size), which only exists in the container’s own IPC namespace: replaces the host namespace by a private one (a shareable namespace stays shareable).

Source

pub fn with_health_check(self, health_check: HealthCheck) -> Self

Source

pub fn with_log_driver(self, log_driver: &str) -> Self

Source

pub fn with_log_option(self, key: &str, value: &str) -> Self

Trait Implementations§

Source§

impl Clone for DockerContainerConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DockerContainerConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for DockerContainerConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for DockerContainerConfig

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for DockerContainerConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for DockerContainerConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more