Struct docker_api::models::HostConfig
source · [−]pub struct HostConfig {Show 38 fields
pub auto_remove: Option<bool>,
pub binds: Option<Vec<String, Global>>,
pub cap_add: Option<Vec<String, Global>>,
pub cap_drop: Option<Vec<String, Global>>,
pub cgroup: Option<String>,
pub cgroupns_mode: Option<String>,
pub console_size: Option<Vec<usize, Global>>,
pub container_id_file: Option<String>,
pub dns: Option<Vec<String, Global>>,
pub dns_options: Option<Vec<String, Global>>,
pub dns_search: Option<Vec<String, Global>>,
pub extra_hosts: Option<Vec<String, Global>>,
pub group_add: Option<Vec<String, Global>>,
pub ipc_mode: Option<String>,
pub isolation: Option<String>,
pub links: Option<Vec<String, Global>>,
pub log_config: Option<HostConfigLogConfigInlineItem>,
pub masked_paths: Option<Vec<String, Global>>,
pub mounts: Option<Vec<Mount, Global>>,
pub network_mode: Option<String>,
pub oom_score_adj: Option<usize>,
pub pid_mode: Option<String>,
pub port_bindings: Option<HashMap<String, Vec<PortBinding, Global>, RandomState>>,
pub privileged: Option<bool>,
pub publish_all_ports: Option<bool>,
pub readonly_paths: Option<Vec<String, Global>>,
pub readonly_rootfs: Option<bool>,
pub restart_policy: Option<RestartPolicy>,
pub runtime: Option<String>,
pub security_opt: Option<Vec<String, Global>>,
pub shm_size: Option<usize>,
pub storage_opt: Option<HashMap<String, String, RandomState>>,
pub sysctls: Option<HashMap<String, String, RandomState>>,
pub tmpfs: Option<HashMap<String, String, RandomState>>,
pub uts_mode: Option<String>,
pub userns_mode: Option<String>,
pub volume_driver: Option<String>,
pub volumes_from: Option<Vec<String, Global>>,
}
Expand description
Container configuration that depends on the host we are running on
Fields
auto_remove: Option<bool>
Automatically remove the container when the container’s process
exits. This has no effect if RestartPolicy
is set.
binds: Option<Vec<String, Global>>
A list of volume bindings for this container. Each volume binding is a string in one of these forms:
host-src:container-dest[:options]
to bind-mount a host path into the container. Bothhost-src
, andcontainer-dest
must be an absolute path.volume-name:container-dest[:options]
to bind-mount a volume managed by a volume driver into the container.container-dest
must be an absolute path.
options
is an optional, comma-delimited list of:
nocopy
disables automatic copying of data from the container path to the volume. Thenocopy
flag only applies to named volumes.[ro|rw]
mounts a volume read-only or read-write, respectively. If omitted or set torw
, volumes are mounted read-write.[z|Z]
applies SELinux labels to allow or deny multiple containers to read and write to the same volume.z
: a shared content label is applied to the content. This label indicates that multiple containers can share the volume content, for both reading and writing.Z
: a private unshared label is applied to the content. This label indicates that only the current container can use a private volume. Labeling systems such as SELinux require proper labels to be placed on volume content that is mounted into a container. Without a label, the security system can prevent a container’s processes from using the content. By default, the labels set by the host operating system are not modified.
[[r]shared|[r]slave|[r]private]
specifies mount propagation behavior. This only applies to bind-mounted volumes, not internal volumes or named volumes. Mount propagation requires the source mount point (the location where the source directory is mounted in the host operating system) to have the correct propagation properties. For shared volumes, the source mount point must be set toshared
. For slave volumes, the mount must be set to eithershared
orslave
.
cap_add: Option<Vec<String, Global>>
A list of kernel capabilities to add to the container. Conflicts with option ‘Capabilities’.
cap_drop: Option<Vec<String, Global>>
A list of kernel capabilities to drop from the container. Conflicts with option ‘Capabilities’.
cgroup: Option<String>
Cgroup to use for the container.
cgroupns_mode: Option<String>
cgroup namespace mode for the container. Possible values are:
"private"
: the container runs in its own private cgroup namespace"host"
: use the host system’s cgroup namespace
If not specified, the daemon default is used, which can either be "private"
or "host"
, depending on daemon version, kernel support and configuration.
console_size: Option<Vec<usize, Global>>
Initial console size, as an [height, width]
array. (Windows only)
container_id_file: Option<String>
Path to a file where the container ID is written
dns: Option<Vec<String, Global>>
A list of DNS servers for the container to use.
dns_options: Option<Vec<String, Global>>
A list of DNS options.
dns_search: Option<Vec<String, Global>>
A list of DNS search domains.
extra_hosts: Option<Vec<String, Global>>
A list of hostnames/IP mappings to add to the container’s /etc/hosts
file. Specified in the form ["hostname:IP"]
.
group_add: Option<Vec<String, Global>>
A list of additional groups that the container process will run as.
ipc_mode: Option<String>
IPC sharing mode for the container. Possible values are:
"none"
: own private IPC namespace, with /dev/shm not mounted"private"
: own private IPC namespace"shareable"
: own private IPC namespace, with a possibility to share it with other containers"container:<name|id>"
: join another (shareable) container’s IPC namespace"host"
: use the host system’s IPC namespace
If not specified, daemon default is used, which can either be "private"
or "shareable"
, depending on daemon version and configuration.
isolation: Option<String>
Isolation technology of the container. (Windows only)
links: Option<Vec<String, Global>>
A list of links for the container in the form container_name:alias
.
log_config: Option<HostConfigLogConfigInlineItem>
The logging configuration for this container
masked_paths: Option<Vec<String, Global>>
The list of paths to be masked inside the container (this overrides the default set of paths).
mounts: Option<Vec<Mount, Global>>
Specification for mounts to be added to the container.
network_mode: Option<String>
Network mode to use for this container. Supported standard values
are: bridge
, host
, none
, and container:<name|id>
. Any
other value is taken as a custom network’s name to which this
container should connect to.
oom_score_adj: Option<usize>
An integer value containing the score given to the container in order to tune OOM killer preferences.
pid_mode: Option<String>
Set the PID (Process) Namespace mode for the container. It can be either:
"container:<name|id>"
: joins another container’s PID namespace"host"
: use the host’s PID namespace inside the container
port_bindings: Option<HashMap<String, Vec<PortBinding, Global>, RandomState>>
privileged: Option<bool>
Gives the container full access to the host.
publish_all_ports: Option<bool>
Allocates an ephemeral host port for all of a container’s exposed ports.
Ports are de-allocated when the container stops and allocated when the container starts. The allocated port might be changed when restarting the container.
The port is selected from the ephemeral port range that depends on
the kernel. For example, on Linux the range is defined by
/proc/sys/net/ipv4/ip_local_port_range
.
readonly_paths: Option<Vec<String, Global>>
The list of paths to be set as read-only inside the container (this overrides the default set of paths).
readonly_rootfs: Option<bool>
Mount the container’s root filesystem as read only.
restart_policy: Option<RestartPolicy>
runtime: Option<String>
Runtime to use with this container.
security_opt: Option<Vec<String, Global>>
A list of string values to customize labels for MLS systems, such as SELinux.
shm_size: Option<usize>
Size of /dev/shm
in bytes. If omitted, the system uses 64MB.
storage_opt: Option<HashMap<String, String, RandomState>>
Storage driver options for this container, in the form {"size": "120G"}
.
sysctls: Option<HashMap<String, String, RandomState>>
A list of kernel parameters (sysctls) to set in the container. For example:
{"net.ipv4.ip_forward": "1"}
tmpfs: Option<HashMap<String, String, RandomState>>
A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options. For example:
{ "/run": "rw,noexec,nosuid,size=65536k" }
uts_mode: Option<String>
UTS namespace to use for the container.
userns_mode: Option<String>
Sets the usernamespace mode for the container when usernamespace remapping option is enabled.
volume_driver: Option<String>
Driver that this container uses to mount volumes.
volumes_from: Option<Vec<String, Global>>
A list of volumes to inherit from another container, specified in
the form <container name>[:<ro|rw>]
.
Trait Implementations
sourceimpl Clone for HostConfig
impl Clone for HostConfig
sourcefn clone(&self) -> HostConfig
fn clone(&self) -> HostConfig
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for HostConfig
impl Debug for HostConfig
sourceimpl<'de> Deserialize<'de> for HostConfig
impl<'de> Deserialize<'de> for HostConfig
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<HostConfig, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<HostConfig, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<HostConfig> for HostConfig
impl PartialEq<HostConfig> for HostConfig
sourcefn eq(&self, other: &HostConfig) -> bool
fn eq(&self, other: &HostConfig) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl Serialize for HostConfig
impl Serialize for HostConfig
sourcefn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for HostConfig
Auto Trait Implementations
impl RefUnwindSafe for HostConfig
impl Send for HostConfig
impl Sync for HostConfig
impl Unpin for HostConfig
impl UnwindSafe for HostConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more