HostConfig class

Constructors

HostConfig.new({int? cpuShares, int memory = 0, String? cgroupParent, int? blkioWeight, List<ResourcesBlkioWeightDeviceInner> blkioWeightDevice = const [], List<ThrottleDevice> blkioDeviceReadBps = const [], List<ThrottleDevice> blkioDeviceWriteBps = const [], List<ThrottleDevice> blkioDeviceReadIOps = const [], List<ThrottleDevice> blkioDeviceWriteIOps = const [], int? cpuPeriod, int? cpuQuota, int? cpuRealtimePeriod, int? cpuRealtimeRuntime, String? cpusetCpus, String? cpusetMems, List<DeviceMapping> devices = const [], List<String> deviceCgroupRules = const [], List<DeviceRequest> deviceRequests = const [], int? kernelMemoryTCP, int? memoryReservation, int? memorySwap, int? memorySwappiness, int? nanoCpus, bool? oomKillDisable, bool? init, int? pidsLimit, List<ResourcesUlimitsInner> ulimits = const [], int? cpuCount, int? cpuPercent, int? iOMaximumIOps, int? iOMaximumBandwidth, List<String> binds = const [], String? containerIDFile, HostConfigAllOfLogConfig? logConfig, String? networkMode, Map<String, List<PortBinding>> portBindings = const {}, RestartPolicy? restartPolicy, bool? autoRemove, String? volumeDriver, List<String> volumesFrom = const [], List<Mount> mounts = const [], List<int>? consoleSize = const [], Map<String, String> annotations = const {}, List<String> capAdd = const [], List<String> capDrop = const [], HostConfigCgroupnsModeEnum? cgroupnsMode, List<String> dns = const [], List<String> dnsOptions = const [], List<String> dnsSearch = const [], List<String> extraHosts = const [], List<String> groupAdd = const [], String? ipcMode, String? cgroup, List<String> links = const [], int? oomScoreAdj, String? pidMode, bool? privileged, bool? publishAllPorts, bool? readonlyRootfs, List<String> securityOpt = const [], Map<String, String> storageOpt = const {}, Map<String, String> tmpfs = const {}, String? uTSMode, String? usernsMode, int? shmSize, Map<String, String> sysctls = const {}, String? runtime, HostConfigIsolationEnum? isolation, List<String> maskedPaths = const [], List<String> readonlyPaths = const []})
Returns a new HostConfig instance.

Properties

annotations Map<String, String>
Arbitrary non-identifying metadata attached to container and provided to the runtime when the container is started.
getter/setter pair
autoRemove bool?
Automatically remove the container when the container's process exits. This has no effect if RestartPolicy is set.
getter/setter pair
binds List<String>
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. Both host-src, and container-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. The nocopy flag only applies to named volumes. - [ro|rw] mounts a volume read-only or read-write, respectively. If omitted or set to rw, 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 to shared. For slave volumes, the mount must be set to either shared or slave.
getter/setter pair
blkioDeviceReadBps List<ThrottleDevice>
Limit read rate (bytes per second) from a device, in the form: [{\"Path\": \"device_path\", \"Rate\": rate}]
getter/setter pair
blkioDeviceReadIOps List<ThrottleDevice>
Limit read rate (IO per second) from a device, in the form: [{\"Path\": \"device_path\", \"Rate\": rate}]
getter/setter pair
blkioDeviceWriteBps List<ThrottleDevice>
Limit write rate (bytes per second) to a device, in the form: [{\"Path\": \"device_path\", \"Rate\": rate}]
getter/setter pair
blkioDeviceWriteIOps List<ThrottleDevice>
Limit write rate (IO per second) to a device, in the form: [{\"Path\": \"device_path\", \"Rate\": rate}]
getter/setter pair
blkioWeight int?
Block IO weight (relative weight).
getter/setter pair
blkioWeightDevice List<ResourcesBlkioWeightDeviceInner>
Block IO weight (relative device weight) in the form: [{\"Path\": \"device_path\", \"Weight\": weight}]
getter/setter pair
capAdd List<String>
A list of kernel capabilities to add to the container. Conflicts with option 'Capabilities'.
getter/setter pair
capDrop List<String>
A list of kernel capabilities to drop from the container. Conflicts with option 'Capabilities'.
getter/setter pair
cgroup String?
Cgroup to use for the container.
getter/setter pair
cgroupnsMode HostConfigCgroupnsModeEnum?
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.
getter/setter pair
cgroupParent String?
Path to cgroups under which the container's cgroup is created. If the path is not absolute, the path is considered to be relative to the cgroups path of the init process. Cgroups are created if they do not already exist.
getter/setter pair
consoleSize List<int>?
Initial console size, as an [height, width] array.
getter/setter pair
containerIDFile String?
Path to a file where the container ID is written
getter/setter pair
cpuCount int?
The number of usable CPUs (Windows only). On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is CPUCount first, then CPUShares, and CPUPercent last.
getter/setter pair
cpuPercent int?
The usable percentage of the available CPUs (Windows only). On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is CPUCount first, then CPUShares, and CPUPercent last.
getter/setter pair
cpuPeriod int?
The length of a CPU period in microseconds.
getter/setter pair
cpuQuota int?
Microseconds of CPU time that the container can get in a CPU period.
getter/setter pair
cpuRealtimePeriod int?
The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks.
getter/setter pair
cpuRealtimeRuntime int?
The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks.
getter/setter pair
cpusetCpus String?
CPUs in which to allow execution (e.g., 0-3, 0,1).
getter/setter pair
cpusetMems String?
Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.
getter/setter pair
cpuShares int?
An integer value representing this container's relative CPU weight versus other containers.
getter/setter pair
deviceCgroupRules List<String>
a list of cgroup rules to apply to the container
getter/setter pair
deviceRequests List<DeviceRequest>
A list of requests for devices to be sent to device drivers.
getter/setter pair
devices List<DeviceMapping>
A list of devices to add to the container.
getter/setter pair
dns List<String>
A list of DNS servers for the container to use.
getter/setter pair
dnsOptions List<String>
A list of DNS options.
getter/setter pair
dnsSearch List<String>
A list of DNS search domains.
getter/setter pair
extraHosts List<String>
A list of hostnames/IP mappings to add to the container's /etc/hosts file. Specified in the form [\"hostname:IP\"].
getter/setter pair
groupAdd List<String>
A list of additional groups that the container process will run as.
getter/setter pair
hashCode int
The hash code for this object.
no setteroverride
init bool?
Run an init inside the container that forwards signals and reaps processes. This field is omitted if empty, and the default (as configured on the daemon) is used.
getter/setter pair
iOMaximumBandwidth int?
Maximum IO in bytes per second for the container system drive (Windows only).
getter/setter pair
iOMaximumIOps int?
Maximum IOps for the container system drive (Windows only)
getter/setter pair
ipcMode 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.
getter/setter pair
isolation HostConfigIsolationEnum?
Isolation technology of the container. (Windows only)
getter/setter pair
kernelMemoryTCP int?
Hard limit for kernel TCP buffer memory (in bytes). Depending on the OCI runtime in use, this option may be ignored. It is no longer supported by the default (runc) runtime. This field is omitted when empty.
getter/setter pair
A list of links for the container in the form container_name:alias.
getter/setter pair
logConfig HostConfigAllOfLogConfig?
Please note: This property should have been non-nullable! Since the specification file does not include a default value (using the "default:" property), however, the generated source code must fall back to having a nullable type. Consider adding a "default:" property in the specification file to hide this note.
getter/setter pair
maskedPaths List<String>
The list of paths to be masked inside the container (this overrides the default set of paths).
getter/setter pair
memory int
Memory limit in bytes.
getter/setter pair
memoryReservation int?
Memory soft limit in bytes.
getter/setter pair
memorySwap int?
Total memory limit (memory + swap). Set as -1 to enable unlimited swap.
getter/setter pair
memorySwappiness int?
Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.
getter/setter pair
mounts List<Mount>
Specification for mounts to be added to the container.
getter/setter pair
nanoCpus int?
CPU quota in units of 10-9 CPUs.
getter/setter pair
networkMode 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.
getter/setter pair
oomKillDisable bool?
Disable OOM Killer for the container.
getter/setter pair
oomScoreAdj int?
An integer value containing the score given to the container in order to tune OOM killer preferences.
getter/setter pair
pidMode 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
getter/setter pair
pidsLimit int?
Tune a container's PIDs limit. Set 0 or -1 for unlimited, or null to not change.
getter/setter pair
portBindings Map<String, List<PortBinding>>
PortMap describes the mapping of container ports to host ports, using the container's port-number and protocol as key in the format <port>/<protocol>, for example, 80/udp. If a container's port is mapped for multiple protocols, separate entries are added to the mapping table.
getter/setter pair
privileged bool?
Gives the container full access to the host.
getter/setter pair
publishAllPorts 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.
getter/setter pair
readonlyPaths List<String>
The list of paths to be set as read-only inside the container (this overrides the default set of paths).
getter/setter pair
readonlyRootfs bool?
Mount the container's root filesystem as read only.
getter/setter pair
restartPolicy RestartPolicy?
Please note: This property should have been non-nullable! Since the specification file does not include a default value (using the "default:" property), however, the generated source code must fall back to having a nullable type. Consider adding a "default:" property in the specification file to hide this note.
getter/setter pair
runtime String?
Runtime to use with this container.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
securityOpt List<String>
A list of string values to customize labels for MLS systems, such as SELinux.
getter/setter pair
shmSize int?
Size of /dev/shm in bytes. If omitted, the system uses 64MB.
getter/setter pair
storageOpt Map<String, String>
Storage driver options for this container, in the form {\"size\": \"120G\"}.
getter/setter pair
sysctls Map<String, String>
A list of kernel parameters (sysctls) to set in the container. For example: {\"net.ipv4.ip_forward\": \"1\"}
getter/setter pair
tmpfs Map<String, String>
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\" }
getter/setter pair
ulimits List<ResourcesUlimitsInner>
A list of resource limits to set in the container. For example: {\"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048}
getter/setter pair
usernsMode String?
Sets the usernamespace mode for the container when usernamespace remapping option is enabled.
getter/setter pair
uTSMode String?
UTS namespace to use for the container.
getter/setter pair
volumeDriver String?
Driver that this container uses to mount volumes.
getter/setter pair
volumesFrom List<String>
A list of volumes to inherit from another container, specified in the form <container name>[:<ro|rw>].
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

fromJson(dynamic value) HostConfig?
Returns a new HostConfig instance and imports its values from value if it's a Map, null otherwise.
listFromJson(dynamic json, {bool growable = false}) List<HostConfig>
mapFromJson(dynamic json) Map<String, HostConfig>
mapListFromJson(dynamic json, {bool growable = false}) Map<String, List<HostConfig>>

Constants

requiredKeys → const Set<String>
The list of required keys that must be present in a JSON.