pub struct HostConfigBuilder { /* private fields */ }
Expand description
Builder for HostConfig
.
Implementations§
Source§impl HostConfigBuilder
impl HostConfigBuilder
Sourcepub fn binds<VALUE: Into<Option<Vec<String>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn binds<VALUE: Into<Option<Vec<String>>>>( &mut self, value: VALUE, ) -> &mut Self
List of volume bindings for this container.
Sourcepub fn container_id_file<VALUE: Into<Option<String>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn container_id_file<VALUE: Into<Option<String>>>( &mut self, value: VALUE, ) -> &mut Self
File (path) where the containerId is written.
Sourcepub fn log_config<VALUE: Into<Option<LogConfig>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn log_config<VALUE: Into<Option<LogConfig>>>( &mut self, value: VALUE, ) -> &mut Self
Configuration of the logs for this container.
Sourcepub fn network_mode<VALUE: Into<Option<String>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn network_mode<VALUE: Into<Option<String>>>( &mut self, value: VALUE, ) -> &mut Self
Network mode to use for the container.
Sourcepub fn port_bindings<VALUE: Into<Option<PortMap>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn port_bindings<VALUE: Into<Option<PortMap>>>( &mut self, value: VALUE, ) -> &mut Self
Port mapping between the exposed port (container) and the host.
Sourcepub fn restart_policy<VALUE: Into<Option<RestartPolicy>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn restart_policy<VALUE: Into<Option<RestartPolicy>>>( &mut self, value: VALUE, ) -> &mut Self
Restart policy to be used for the container.
Sourcepub fn auto_remove<VALUE: Into<Option<bool>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn auto_remove<VALUE: Into<Option<bool>>>( &mut self, value: VALUE, ) -> &mut Self
Automatically remove container when it exits.
Sourcepub fn volume_driver<VALUE: Into<Option<String>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn volume_driver<VALUE: Into<Option<String>>>( &mut self, value: VALUE, ) -> &mut Self
Name of the volume driver used to mount volumes.
Sourcepub fn volumes_from<VALUE: Into<Option<Vec<String>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn volumes_from<VALUE: Into<Option<Vec<String>>>>( &mut self, value: VALUE, ) -> &mut Self
List of volumes to take from other container.
Sourcepub fn cap_add<VALUE: Into<Option<Vec<String>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn cap_add<VALUE: Into<Option<Vec<String>>>>( &mut self, value: VALUE, ) -> &mut Self
List of kernel capabilities to add to the container.
Sourcepub fn cap_drop<VALUE: Into<Option<Vec<String>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn cap_drop<VALUE: Into<Option<Vec<String>>>>( &mut self, value: VALUE, ) -> &mut Self
List of kernel capabilities to remove from the container.
Sourcepub fn capabilities<VALUE: Into<Option<Vec<String>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn capabilities<VALUE: Into<Option<Vec<String>>>>( &mut self, value: VALUE, ) -> &mut Self
List of kernel capabilities to be available for container (this overrides the default set).
Sourcepub fn cgroup_ns_mode<VALUE: Into<Option<String>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn cgroup_ns_mode<VALUE: Into<Option<String>>>( &mut self, value: VALUE, ) -> &mut Self
Cgroup namespace mode to use for the container.
Sourcepub fn dns<VALUE: Into<Option<Vec<String>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn dns<VALUE: Into<Option<Vec<String>>>>( &mut self, value: VALUE, ) -> &mut Self
List of DNS server to lookup.
Sourcepub fn dns_options<VALUE: Into<Option<Vec<String>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn dns_options<VALUE: Into<Option<Vec<String>>>>( &mut self, value: VALUE, ) -> &mut Self
List of DNSOption to look for.
Sourcepub fn dns_search<VALUE: Into<Option<Vec<String>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn dns_search<VALUE: Into<Option<Vec<String>>>>( &mut self, value: VALUE, ) -> &mut Self
List of DNSSearch to look for.
Sourcepub fn extra_hosts<VALUE: Into<Option<Vec<String>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn extra_hosts<VALUE: Into<Option<Vec<String>>>>( &mut self, value: VALUE, ) -> &mut Self
List of extra hosts.
Sourcepub fn group_add<VALUE: Into<Option<Vec<String>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn group_add<VALUE: Into<Option<Vec<String>>>>( &mut self, value: VALUE, ) -> &mut Self
List of additional groups that the container process will run as.
Sourcepub fn ipc_mode<VALUE: Into<Option<String>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn ipc_mode<VALUE: Into<Option<String>>>( &mut self, value: VALUE, ) -> &mut Self
IPC namespace to use for the container.
Sourcepub fn cgroup<VALUE: Into<Option<String>>>(&mut self, value: VALUE) -> &mut Self
pub fn cgroup<VALUE: Into<Option<String>>>(&mut self, value: VALUE) -> &mut Self
Cgroup to use for the container.
Sourcepub fn links<VALUE: Into<Option<Vec<String>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn links<VALUE: Into<Option<Vec<String>>>>( &mut self, value: VALUE, ) -> &mut Self
List of links (in the name:alias form).
Sourcepub fn oom_score_adj<VALUE: Into<Option<i32>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn oom_score_adj<VALUE: Into<Option<i32>>>( &mut self, value: VALUE, ) -> &mut Self
Container preference for OOM-killing.
Sourcepub fn pid_mode<VALUE: Into<Option<String>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn pid_mode<VALUE: Into<Option<String>>>( &mut self, value: VALUE, ) -> &mut Self
PID namespace to use for the container.
Sourcepub fn privileged<VALUE: Into<Option<bool>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn privileged<VALUE: Into<Option<bool>>>( &mut self, value: VALUE, ) -> &mut Self
Is the container in privileged mode.
Sourcepub fn publish_all_ports<VALUE: Into<Option<bool>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn publish_all_ports<VALUE: Into<Option<bool>>>( &mut self, value: VALUE, ) -> &mut Self
Should docker publish all exposed port for the container.
Sourcepub fn readonly_rootfs<VALUE: Into<Option<bool>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn readonly_rootfs<VALUE: Into<Option<bool>>>( &mut self, value: VALUE, ) -> &mut Self
Is the container root filesystem in read-only.
Sourcepub fn security_opt<VALUE: Into<Option<Vec<String>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn security_opt<VALUE: Into<Option<Vec<String>>>>( &mut self, value: VALUE, ) -> &mut Self
List of string values to customize labels for MLS systems, such as SELinux.
Sourcepub fn storage_opt<VALUE: Into<Option<HashMap<String, String>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn storage_opt<VALUE: Into<Option<HashMap<String, String>>>>( &mut self, value: VALUE, ) -> &mut Self
Storage driver options per container.
Sourcepub fn tmpfs<VALUE: Into<Option<HashMap<String, String>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn tmpfs<VALUE: Into<Option<HashMap<String, String>>>>( &mut self, value: VALUE, ) -> &mut Self
List of tmpfs (mounts) used for the container.
Sourcepub fn uts_mode<VALUE: Into<Option<String>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn uts_mode<VALUE: Into<Option<String>>>( &mut self, value: VALUE, ) -> &mut Self
UTS namespace to use for the container.
Sourcepub fn user_ns_mode<VALUE: Into<Option<String>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn user_ns_mode<VALUE: Into<Option<String>>>( &mut self, value: VALUE, ) -> &mut Self
The user namespace to use for the container.
Sourcepub fn shm_size<VALUE: Into<Option<i64>>>(&mut self, value: VALUE) -> &mut Self
pub fn shm_size<VALUE: Into<Option<i64>>>(&mut self, value: VALUE) -> &mut Self
Total shm memory usage.
Sourcepub fn sysctls<VALUE: Into<Option<HashMap<String, String>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn sysctls<VALUE: Into<Option<HashMap<String, String>>>>( &mut self, value: VALUE, ) -> &mut Self
List of Namespaced sysctls used for the container.
Sourcepub fn runtime<VALUE: Into<Option<String>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn runtime<VALUE: Into<Option<String>>>( &mut self, value: VALUE, ) -> &mut Self
Runtime to use with this container.
Sourcepub fn console_size<VALUE: Into<Option<[u32; 2]>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn console_size<VALUE: Into<Option<[u32; 2]>>>( &mut self, value: VALUE, ) -> &mut Self
Initial console size (height,width).
Sourcepub fn isolation<VALUE: Into<Option<String>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn isolation<VALUE: Into<Option<String>>>( &mut self, value: VALUE, ) -> &mut Self
Isolation technology of the container (e.g. default, hyperv).
CPU shares (relative weight vs. other containers).
Sourcepub fn memory<VALUE: Into<Option<i64>>>(&mut self, value: VALUE) -> &mut Self
pub fn memory<VALUE: Into<Option<i64>>>(&mut self, value: VALUE) -> &mut Self
Memory limit (in bytes).
Sourcepub fn nano_cpus<VALUE: Into<Option<i64>>>(&mut self, value: VALUE) -> &mut Self
pub fn nano_cpus<VALUE: Into<Option<i64>>>(&mut self, value: VALUE) -> &mut Self
CPU quota in units of 10-9 CPUs.
Sourcepub fn cgroup_parent<VALUE: Into<Option<String>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn cgroup_parent<VALUE: Into<Option<String>>>( &mut self, value: VALUE, ) -> &mut Self
Parent cgroup.
Sourcepub fn blkio_weight<VALUE: Into<Option<u16>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn blkio_weight<VALUE: Into<Option<u16>>>( &mut self, value: VALUE, ) -> &mut Self
Block IO weight (relative weight vs. other containers).
pub fn blkio_weight_device<VALUE: Into<Option<Vec<WeightDevice>>>>( &mut self, value: VALUE, ) -> &mut Self
pub fn blkio_device_read_bps<VALUE: Into<Option<Vec<ThrottleDevice>>>>( &mut self, value: VALUE, ) -> &mut Self
pub fn blkio_device_write_bps<VALUE: Into<Option<Vec<ThrottleDevice>>>>( &mut self, value: VALUE, ) -> &mut Self
pub fn blkio_device_read_iops<VALUE: Into<Option<Vec<ThrottleDevice>>>>( &mut self, value: VALUE, ) -> &mut Self
pub fn blkio_device_write_iops<VALUE: Into<Option<Vec<ThrottleDevice>>>>( &mut self, value: VALUE, ) -> &mut Self
Sourcepub fn cpu_period<VALUE: Into<Option<i64>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn cpu_period<VALUE: Into<Option<i64>>>( &mut self, value: VALUE, ) -> &mut Self
CPU CFS (Completely Fair Scheduler) period.
Sourcepub fn cpu_quota<VALUE: Into<Option<i64>>>(&mut self, value: VALUE) -> &mut Self
pub fn cpu_quota<VALUE: Into<Option<i64>>>(&mut self, value: VALUE) -> &mut Self
CPU CFS (Completely Fair Scheduler) quota.
Sourcepub fn cpu_realtime_period<VALUE: Into<Option<i64>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn cpu_realtime_period<VALUE: Into<Option<i64>>>( &mut self, value: VALUE, ) -> &mut Self
CPU real-time period.
Sourcepub fn cpu_realtime_runtime<VALUE: Into<Option<i64>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn cpu_realtime_runtime<VALUE: Into<Option<i64>>>( &mut self, value: VALUE, ) -> &mut Self
CPU real-time runtime.
Sourcepub fn cpuset_cpus<VALUE: Into<Option<String>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn cpuset_cpus<VALUE: Into<Option<String>>>( &mut self, value: VALUE, ) -> &mut Self
CpusetCpus 0-2, 0,1.
Sourcepub fn cpuset_mems<VALUE: Into<Option<String>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn cpuset_mems<VALUE: Into<Option<String>>>( &mut self, value: VALUE, ) -> &mut Self
CpusetMems 0-2, 0,1.
Sourcepub fn devices<VALUE: Into<Option<Vec<DeviceMapping>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn devices<VALUE: Into<Option<Vec<DeviceMapping>>>>( &mut self, value: VALUE, ) -> &mut Self
List of devices to map inside the container.
Sourcepub fn device_cgroup_rules<VALUE: Into<Option<Vec<String>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn device_cgroup_rules<VALUE: Into<Option<Vec<String>>>>( &mut self, value: VALUE, ) -> &mut Self
List of rule to be added to the device cgroup.
Sourcepub fn device_requests<VALUE: Into<Option<Vec<DeviceRequest>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn device_requests<VALUE: Into<Option<Vec<DeviceRequest>>>>( &mut self, value: VALUE, ) -> &mut Self
List of device requests for device drivers.
Sourcepub fn kernel_memory<VALUE: Into<Option<i64>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn kernel_memory<VALUE: Into<Option<i64>>>( &mut self, value: VALUE, ) -> &mut Self
Kernel memory limit (in bytes).
Sourcepub fn kernel_memory_tcp<VALUE: Into<Option<i64>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn kernel_memory_tcp<VALUE: Into<Option<i64>>>( &mut self, value: VALUE, ) -> &mut Self
Hard limit for kernel TCP buffer memory (in bytes).
Sourcepub fn memory_reservation<VALUE: Into<Option<i64>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn memory_reservation<VALUE: Into<Option<i64>>>( &mut self, value: VALUE, ) -> &mut Self
Memory soft limit (in bytes).
Sourcepub fn memory_swap<VALUE: Into<Option<i64>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn memory_swap<VALUE: Into<Option<i64>>>( &mut self, value: VALUE, ) -> &mut Self
Total memory usage (memory + swap); set -1
to enable unlimited swap.
Sourcepub fn memory_swappiness<VALUE: Into<Option<i64>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn memory_swappiness<VALUE: Into<Option<i64>>>( &mut self, value: VALUE, ) -> &mut Self
Tuning container memory swappiness behaviour.
Sourcepub fn oom_kill_disable<VALUE: Into<Option<bool>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn oom_kill_disable<VALUE: Into<Option<bool>>>( &mut self, value: VALUE, ) -> &mut Self
Whether to disable OOM Killer or not.
Sourcepub fn pids_limit<VALUE: Into<Option<i64>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn pids_limit<VALUE: Into<Option<i64>>>( &mut self, value: VALUE, ) -> &mut Self
Setting PIDs limit for a container; Set 0
or -1
for unlimited, or null
to not change.
Sourcepub fn ulimits<VALUE: Into<Option<Vec<Ulimit>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn ulimits<VALUE: Into<Option<Vec<Ulimit>>>>( &mut self, value: VALUE, ) -> &mut Self
List of ulimits to be set in the container.
Sourcepub fn cpu_percent<VALUE: Into<Option<i64>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn cpu_percent<VALUE: Into<Option<i64>>>( &mut self, value: VALUE, ) -> &mut Self
CPU percent.
Sourcepub fn io_maximum_iops<VALUE: Into<Option<u64>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn io_maximum_iops<VALUE: Into<Option<u64>>>( &mut self, value: VALUE, ) -> &mut Self
Maximum IOps for the container system drive.
Sourcepub fn io_maximum_bandwidth<VALUE: Into<Option<u64>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn io_maximum_bandwidth<VALUE: Into<Option<u64>>>( &mut self, value: VALUE, ) -> &mut Self
Maximum IO in bytes per second for the container system drive.
Sourcepub fn mounts<VALUE: Into<Option<Vec<Mount>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn mounts<VALUE: Into<Option<Vec<Mount>>>>( &mut self, value: VALUE, ) -> &mut Self
Mounts specs used by the container.
Sourcepub fn masked_paths<VALUE: Into<Option<Vec<String>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn masked_paths<VALUE: Into<Option<Vec<String>>>>( &mut self, value: VALUE, ) -> &mut Self
MaskedPaths is the list of paths to be masked inside the container (this overrides the default set of paths).
Sourcepub fn readonly_paths<VALUE: Into<Option<Vec<String>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn readonly_paths<VALUE: Into<Option<Vec<String>>>>( &mut self, value: VALUE, ) -> &mut Self
ReadonlyPaths is the list of paths to be set as read-only inside the container (this overrides the default set of paths).
Trait Implementations§
Source§impl Clone for HostConfigBuilder
impl Clone for HostConfigBuilder
Source§fn clone(&self) -> HostConfigBuilder
fn clone(&self) -> HostConfigBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more