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