pub struct DockerOverrides {Show 19 fields
pub image: Option<String>,
pub extra_args: Vec<String>,
pub entrypoint: Option<String>,
pub command: Option<Vec<String>>,
pub user: Option<String>,
pub gpus: Option<String>,
pub platform: Option<String>,
pub privileged: bool,
pub security_opt: Vec<String>,
pub sysctls: HashMap<String, String>,
pub labels: HashMap<String, String>,
pub restart: Option<String>,
pub rm: bool,
pub init: bool,
pub hostname: Option<String>,
pub ipc: Option<String>,
pub pid: Option<String>,
pub cap_add: Vec<String>,
pub cap_drop: Vec<String>,
}Expand description
Docker runtime overrides.
Fields§
§image: Option<String>Override container image.
extra_args: Vec<String>Additional docker run arguments.
entrypoint: Option<String>Override entrypoint.
command: Option<Vec<String>>Override command.
user: Option<String>User to run as (uid:gid).
gpus: Option<String>GPU configuration.
platform: Option<String>Platform for multi-arch support.
privileged: boolPrivileged mode (dangerous!).
security_opt: Vec<String>Security options.
sysctls: HashMap<String, String>Sysctls.
labels: HashMap<String, String>Container labels.
restart: Option<String>Restart policy.
rm: boolRemove container after execution.
init: boolInit process.
hostname: Option<String>Hostname.
ipc: Option<String>IPC mode.
pid: Option<String>PID mode.
cap_add: Vec<String>Capabilities to add.
cap_drop: Vec<String>Capabilities to drop.
Implementations§
Source§impl DockerOverrides
impl DockerOverrides
Sourcepub fn with_image(self, image: impl Into<String>) -> Self
pub fn with_image(self, image: impl Into<String>) -> Self
Set container image.
Sourcepub fn with_extra_arg(self, arg: impl Into<String>) -> Self
pub fn with_extra_arg(self, arg: impl Into<String>) -> Self
Add extra docker run argument.
Sourcepub fn with_entrypoint(self, entrypoint: impl Into<String>) -> Self
pub fn with_entrypoint(self, entrypoint: impl Into<String>) -> Self
Set entrypoint.
Sourcepub fn with_command(self, command: Vec<String>) -> Self
pub fn with_command(self, command: Vec<String>) -> Self
Set command.
Sourcepub fn with_all_gpus(self) -> Self
pub fn with_all_gpus(self) -> Self
Enable all GPUs.
Sourcepub fn with_platform(self, platform: impl Into<String>) -> Self
pub fn with_platform(self, platform: impl Into<String>) -> Self
Set platform.
Sourcepub fn privileged(self) -> Self
pub fn privileged(self) -> Self
Enable privileged mode (dangerous!).
Sourcepub fn with_security_opt(self, opt: impl Into<String>) -> Self
pub fn with_security_opt(self, opt: impl Into<String>) -> Self
Add security option.
Sourcepub fn with_no_new_privileges(self) -> Self
pub fn with_no_new_privileges(self) -> Self
Disable new privileges.
Sourcepub fn with_sysctl(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_sysctl( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add sysctl.
Sourcepub fn with_label(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_label( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add label.
Sourcepub fn with_restart(self, policy: impl Into<String>) -> Self
pub fn with_restart(self, policy: impl Into<String>) -> Self
Set restart policy.
Sourcepub fn keep_container(self) -> Self
pub fn keep_container(self) -> Self
Keep container after execution.
Sourcepub fn with_hostname(self, hostname: impl Into<String>) -> Self
pub fn with_hostname(self, hostname: impl Into<String>) -> Self
Set hostname.
Sourcepub fn add_capability(self, cap: impl Into<String>) -> Self
pub fn add_capability(self, cap: impl Into<String>) -> Self
Add a capability.
Sourcepub fn drop_capability(self, cap: impl Into<String>) -> Self
pub fn drop_capability(self, cap: impl Into<String>) -> Self
Drop a capability.
Sourcepub fn drop_all_capabilities(self) -> Self
pub fn drop_all_capabilities(self) -> Self
Drop all capabilities.
Sourcepub fn to_docker_args(&self) -> Vec<String>
pub fn to_docker_args(&self) -> Vec<String>
Build docker run arguments from these overrides.
Trait Implementations§
Source§impl Clone for DockerOverrides
impl Clone for DockerOverrides
Source§fn clone(&self) -> DockerOverrides
fn clone(&self) -> DockerOverrides
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more