ContainerState class

Input properties used for looking up and filtering Container resources.

Constructors

ContainerState({Input<bool?>? attach, Input<String?>? bridge, Input<ContainerCapabilities?>? capabilities, Input<String?>? cgroupParent, Input<String?>? cgroupnsMode, Input<List<String>?>? command, Input<String?>? containerLogs, Input<int?>? containerReadRefreshTimeoutMilliseconds, Input<int?>? cpuPeriod, Input<int?>? cpuQuota, Input<String?>? cpuSet, Input<int?>? cpuShares, Input<String?>? cpus, Input<int?>? destroyGraceSeconds, Input<List<String>?>? deviceCgroupRules, Input<List<ContainerDeviceReadBp>?>? deviceReadBps, Input<List<ContainerDeviceReadIop>?>? deviceReadIops, Input<List<ContainerDeviceRequest>?>? deviceRequests, Input<List<ContainerDeviceWriteBp>?>? deviceWriteBps, Input<List<ContainerDeviceWriteIop>?>? deviceWriteIops, Input<List<ContainerDevice>?>? devices, Input<List<String>?>? dns, Input<List<String>?>? dnsOpts, Input<List<String>?>? dnsSearches, Input<String?>? domainname, Input<List<String>?>? entrypoints, Input<List<String>?>? envs, Input<int?>? exitCode, Input<String?>? gpus, Input<List<String>?>? groupAdds, Input<ContainerHealthcheck?>? healthcheck, Input<String?>? hostname, Input<List<ContainerHost>?>? hosts, Input<String?>? image, Input<bool?>? init, Input<String?>? ipcMode, Input<List<ContainerLabel>?>? labels, Input<String?>? logDriver, Input<Map<String, String>?>? logOpts, Input<bool?>? logs, Input<int?>? maxRetryCount, Input<int?>? memory, Input<int?>? memoryReservation, Input<int?>? memorySwap, Input<List<ContainerMount>?>? mounts, Input<bool?>? mustRun, Input<String?>? name, Input<List<ContainerNetworkData>?>? networkDatas, Input<String?>? networkMode, Input<List<ContainerNetworksAdvanced>?>? networksAdvanced, Input<String?>? pidMode, Input<String?>? platform, Input<List<ContainerPort>?>? ports, Input<bool?>? privileged, Input<bool?>? publishAllPorts, Input<bool?>? readOnly, Input<bool?>? removeVolumes, Input<String?>? restart, Input<bool?>? rm, Input<String?>? runtime, Input<List<String>?>? securityOpts, Input<int?>? shmSize, Input<bool?>? start, Input<bool?>? stdinOpen, Input<String?>? stopSignal, Input<int?>? stopTimeout, Input<Map<String, String>?>? storageOpts, Input<Map<String, String>?>? sysctls, Input<Map<String, String>?>? tmpfs, Input<bool?>? tty, Input<List<ContainerUlimit>?>? ulimits, Input<List<ContainerUpload>?>? uploads, Input<String?>? user, Input<String?>? usernsMode, Input<List<ContainerVolume>?>? volumes, Input<bool?>? wait, Input<int?>? waitTimeout, Input<String?>? workingDir})
Creates a new ContainerState. attach If true attach to the container after its creation and waits the end of its execution. Defaults to false. bridge The network bridge of the container as read from its NetworkSettings. capabilities Add or drop certain linux capabilities. cgroupParent Optional parent cgroup for the container cgroupnsMode Cgroup namespace mode to use for the container. Possible values are: private, host. command The command to use to start the container. For example, to run /usr/bin/myprogram -f baz.conf set the command to be ["/usr/bin/myprogram","-f","baz.conf"]. containerLogs The logs of the container if its execution is done (attach must be disabled). containerReadRefreshTimeoutMilliseconds The total number of milliseconds to wait for the container to reach status 'running' cpuPeriod Specify the CPU CFS scheduler period (in microseconds), which is used alongside cpu-quota. Is ignored if cpus is set. cpuQuota Impose a CPU CFS quota on the container (in microseconds). The number of microseconds per cpu-period that the container is limited to before throttled. Is ignored if cpus is set. cpuSet A comma-separated list or hyphen-separated range of CPUs a container can use, e.g. 0-1. cpuShares CPU shares (relative weight) for the container. cpus Specify how much of the available CPU resources a container can use. e.g a value of 1.5 means the container is guaranteed at most one and a half of the CPUs. Has precedence over cpuPeriod and cpuQuota. destroyGraceSeconds If defined will attempt to stop the container before destroying. Container will be destroyed after n seconds or on successful stop. deviceCgroupRules Cgroup rules to allow access to classes of devices without binding specific device nodes. deviceReadBps Limit read rate (bytes per second) from a device. This is the equivalent to repeating --device-read-bps for docker run. deviceReadIops Limit read rate (IO per second) from a device. This is the equivalent to repeating --device-read-iops for docker run. deviceRequests Device requests for the container, such as CDI devices (e.g., nvidia.com/gpu=all) or GPU requests. This is the equivalent to using the --device flag for CDI devices in docker run. deviceWriteBps Limit write rate (bytes per second) to a device. This is the equivalent to repeating --device-write-bps for docker run. deviceWriteIops Limit write rate (IO per second) to a device. This is the equivalent to repeating --device-write-iops for docker run. devices Bind traditional devices to the container (e.g., /dev/nvidia0). For CDI devices, use deviceRequests instead. dns DNS servers to use. dnsOpts DNS options used by the DNS provider(s), see resolv.conf documentation for valid list of options. dnsSearches DNS search domains that are used when bare unqualified hostnames are used inside of the container. domainname Domain name of the container. entrypoints The command to use as the Entrypoint for the container. The Entrypoint allows you to configure a container to run as an executable. For example, to run /usr/bin/myprogram when starting a container, set the entrypoint to be "/usr/bin/myprogram"]. envs Environment variables to set in the form of KEY=VALUE, e.g. DEBUG=0 exitCode The exit code of the container if its execution is done (mustRun must be disabled). gpus GPU devices to add to the container. Supported values are all or device=&lt;id[,id...]&gt;, for example device=0,2 or device=GPU-3a23c669-1f69-c64e-cf85-44e9b07e7a2a. groupAdds Additional groups for the container user healthcheck A test to perform to check that the container is healthy hostname Hostname of the container. hosts Additional hosts to add to the container. image The ID of the image to back this container. The easiest way to get this value is to use the imageId attribute of the docker.RemoteImage resource as is shown in the example. init Configured whether an init process should be injected for this container. If unset this will default to the dockerd defaults. ipcMode IPC sharing mode for the container. Possible values are: none, private, shareable, container:&lt;name|id&gt; or host. labels User-defined key/value metadata logDriver The logging driver to use for the container. logOpts Key/value pairs to use as options for the logging driver. logs Save the container logs (attach must be enabled). Defaults to false. maxRetryCount The maximum amount of times to an attempt a restart when restart is set to 'on-failure'. memory The memory limit for the container in MBs. memoryReservation The memory-resveration for the container in MBs. Defaults to 0. Allows you to specify a soft limit smaller than memory which is activated when Docker detects contention or low memory on the host machine. If you use memory-reservation, it must be set lower than memory for it to take precedence. Because it is a soft limit, it doesn't guarantee that the container doesn't exceed the limit. memorySwap The total memory limit (memory + swap) for the container in MBs. This setting may compute to -1 after pulumi up if the target host doesn't support memory swap, when that is the case docker will use a soft limitation. mounts Specification for mounts to be added to containers created as part of the service. mustRun If true, then the Docker container will be kept running. If false, Terraform leaves the container alone. This attribute is also used to trigger a restart of a stopped container. If your container is stopped, Terraform will set mustRun to false and this will trigger a change. Defaults to true. name The name of the container. networkDatas The data of the networks the container is connected to. networkMode Network mode of the container. Defaults to bridge. If your host OS is any other OS, you need to set this value explicitly, e.g. nat when your container will be running on an Windows host. See https://docs.docker.com/engine/network/ for more information. networksAdvanced The networks the container is attached to. This is the equivalent to the --network option of docker run pidMode The PID (Process) Namespace mode for the container. Either container:&lt;name|id&gt; or host. platform Platform in the format os[/arch[/variant]] used for image lookup and container runtime, for example linux/amd64. ports Publish a container's port(s) to the host. privileged If true, the container runs in privileged mode. publishAllPorts Publish all ports of the container. readOnly If true, the container will be started as readonly. Defaults to false. removeVolumes If true, it will remove anonymous volumes associated with the container. Defaults to true. restart The restart policy for the container. Must be one of 'no', 'on-failure', 'always', 'unless-stopped'. Defaults to no. rm If true, then the container will be automatically removed when it exits. Defaults to false. runtime Runtime to use for the container. securityOpts List of string values to customize labels for MLS systems, such as SELinux. See https://docs.docker.com/engine/reference/run/#security-configuration. shmSize Size of /dev/shm in MBs. start If true, then the Docker container will be started after creation. If false, then the container is only created. Defaults to true. stdinOpen If true, keep STDIN open even if not attached (docker run -i). Defaults to false. stopSignal Signal to stop a container (default SIGTERM). stopTimeout Timeout (in seconds) to stop a container. storageOpts Key/value pairs for the storage driver options, e.g. size: 120G sysctls A map of kernel parameters (sysctls) to set in the container. tmpfs A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options. tty If true, allocate a pseudo-tty (docker run -t). Defaults to false. ulimits Ulimit options to add. uploads Specifies files to upload to the container before starting it. Only one of content or contentBase64 can be set and at least one of them has to be set. user User used for run the first process. Format is user or user:group which user and group can be passed literally or by name. usernsMode Sets the usernamespace mode for the container when usernamespace remapping option is enabled. volumes Spec for mounting volumes in the container. wait If true, then the Docker container is waited for being healthy state after creation. This requires your container to have a healthcheck, otherwise this provider will error. If false, then the container health state is not checked. Defaults to false. waitTimeout The timeout in seconds to wait the container to be healthy after creation. Defaults to 60. workingDir The working directory for commands to run in.
const
ContainerState.fromMap(Map<String, dynamic> map)
factory

Properties

attach → Input<bool?>?
If true attach to the container after its creation and waits the end of its execution. Defaults to false.
final
bridge → Input<String?>?
The network bridge of the container as read from its NetworkSettings.
final
capabilities → Input<ContainerCapabilities?>?
Add or drop certain linux capabilities.
final
cgroupnsMode → Input<String?>?
Cgroup namespace mode to use for the container. Possible values are: private, host.
final
cgroupParent → Input<String?>?
Optional parent cgroup for the container
final
command → Input<List<String>?>?
The command to use to start the container. For example, to run /usr/bin/myprogram -f baz.conf set the command to be ["/usr/bin/myprogram","-f","baz.conf"].
final
containerLogs → Input<String?>?
The logs of the container if its execution is done (attach must be disabled).
final
containerReadRefreshTimeoutMilliseconds → Input<int?>?
The total number of milliseconds to wait for the container to reach status 'running'
final
cpuPeriod → Input<int?>?
Specify the CPU CFS scheduler period (in microseconds), which is used alongside cpu-quota. Is ignored if cpus is set.
final
cpuQuota → Input<int?>?
Impose a CPU CFS quota on the container (in microseconds). The number of microseconds per cpu-period that the container is limited to before throttled. Is ignored if cpus is set.
final
cpus → Input<String?>?
Specify how much of the available CPU resources a container can use. e.g a value of 1.5 means the container is guaranteed at most one and a half of the CPUs. Has precedence over cpuPeriod and cpuQuota.
final
cpuSet → Input<String?>?
A comma-separated list or hyphen-separated range of CPUs a container can use, e.g. 0-1.
final
cpuShares → Input<int?>?
CPU shares (relative weight) for the container.
final
destroyGraceSeconds → Input<int?>?
If defined will attempt to stop the container before destroying. Container will be destroyed after n seconds or on successful stop.
final
deviceCgroupRules → Input<List<String>?>?
Cgroup rules to allow access to classes of devices without binding specific device nodes.
final
deviceReadBps → Input<List<ContainerDeviceReadBp>?>?
Limit read rate (bytes per second) from a device. This is the equivalent to repeating --device-read-bps for docker run.
final
deviceReadIops → Input<List<ContainerDeviceReadIop>?>?
Limit read rate (IO per second) from a device. This is the equivalent to repeating --device-read-iops for docker run.
final
deviceRequests → Input<List<ContainerDeviceRequest>?>?
Device requests for the container, such as CDI devices (e.g., nvidia.com/gpu=all) or GPU requests. This is the equivalent to using the --device flag for CDI devices in docker run.
final
devices → Input<List<ContainerDevice>?>?
Bind traditional devices to the container (e.g., /dev/nvidia0). For CDI devices, use deviceRequests instead.
final
deviceWriteBps → Input<List<ContainerDeviceWriteBp>?>?
Limit write rate (bytes per second) to a device. This is the equivalent to repeating --device-write-bps for docker run.
final
deviceWriteIops → Input<List<ContainerDeviceWriteIop>?>?
Limit write rate (IO per second) to a device. This is the equivalent to repeating --device-write-iops for docker run.
final
dns → Input<List<String>?>?
DNS servers to use.
final
dnsOpts → Input<List<String>?>?
DNS options used by the DNS provider(s), see resolv.conf documentation for valid list of options.
final
dnsSearches → Input<List<String>?>?
DNS search domains that are used when bare unqualified hostnames are used inside of the container.
final
domainname → Input<String?>?
Domain name of the container.
final
entrypoints → Input<List<String>?>?
The command to use as the Entrypoint for the container. The Entrypoint allows you to configure a container to run as an executable. For example, to run /usr/bin/myprogram when starting a container, set the entrypoint to be "/usr/bin/myprogram"].
final
envs → Input<List<String>?>?
Environment variables to set in the form of KEY=VALUE, e.g. DEBUG=0
final
exitCode → Input<int?>?
The exit code of the container if its execution is done (mustRun must be disabled).
final
gpus → Input<String?>?
GPU devices to add to the container. Supported values are all or device=&lt;id[,id...]&gt;, for example device=0,2 or device=GPU-3a23c669-1f69-c64e-cf85-44e9b07e7a2a.
final
groupAdds → Input<List<String>?>?
Additional groups for the container user
final
hashCode → int
The hash code for this object.
no setterinherited
healthcheck → Input<ContainerHealthcheck?>?
A test to perform to check that the container is healthy
final
hostname → Input<String?>?
Hostname of the container.
final
hosts → Input<List<ContainerHost>?>?
Additional hosts to add to the container.
final
image → Input<String?>?
The ID of the image to back this container. The easiest way to get this value is to use the imageId attribute of the docker.RemoteImage resource as is shown in the example.
final
init → Input<bool?>?
Configured whether an init process should be injected for this container. If unset this will default to the dockerd defaults.
final
ipcMode → Input<String?>?
IPC sharing mode for the container. Possible values are: none, private, shareable, container:&lt;name|id&gt; or host.
final
labels → Input<List<ContainerLabel>?>?
User-defined key/value metadata
final
logDriver → Input<String?>?
The logging driver to use for the container.
final
logOpts → Input<Map<String, String>?>?
Key/value pairs to use as options for the logging driver.
final
logs → Input<bool?>?
Save the container logs (attach must be enabled). Defaults to false.
final
maxRetryCount → Input<int?>?
The maximum amount of times to an attempt a restart when restart is set to 'on-failure'.
final
memory → Input<int?>?
The memory limit for the container in MBs.
final
memoryReservation → Input<int?>?
The memory-resveration for the container in MBs. Defaults to 0. Allows you to specify a soft limit smaller than memory which is activated when Docker detects contention or low memory on the host machine. If you use memory-reservation, it must be set lower than memory for it to take precedence. Because it is a soft limit, it doesn't guarantee that the container doesn't exceed the limit.
final
memorySwap → Input<int?>?
The total memory limit (memory + swap) for the container in MBs. This setting may compute to -1 after pulumi up if the target host doesn't support memory swap, when that is the case docker will use a soft limitation.
final
mounts → Input<List<ContainerMount>?>?
Specification for mounts to be added to containers created as part of the service.
final
mustRun → Input<bool?>?
If true, then the Docker container will be kept running. If false, Terraform leaves the container alone. This attribute is also used to trigger a restart of a stopped container. If your container is stopped, Terraform will set mustRun to false and this will trigger a change. Defaults to true.
final
name → Input<String?>?
The name of the container.
final
networkDatas → Input<List<ContainerNetworkData>?>?
The data of the networks the container is connected to.
final
networkMode → Input<String?>?
Network mode of the container. Defaults to bridge. If your host OS is any other OS, you need to set this value explicitly, e.g. nat when your container will be running on an Windows host. See https://docs.docker.com/engine/network/ for more information.
final
networksAdvanced → Input<List<ContainerNetworksAdvanced>?>?
The networks the container is attached to. This is the equivalent to the --network option of docker run
final
pidMode → Input<String?>?
The PID (Process) Namespace mode for the container. Either container:&lt;name|id&gt; or host.
final
platform → Input<String?>?
Platform in the format os[/arch[/variant]] used for image lookup and container runtime, for example linux/amd64.
final
ports → Input<List<ContainerPort>?>?
Publish a container's port(s) to the host.
final
privileged → Input<bool?>?
If true, the container runs in privileged mode.
final
publishAllPorts → Input<bool?>?
Publish all ports of the container.
final
readOnly → Input<bool?>?
If true, the container will be started as readonly. Defaults to false.
final
removeVolumes → Input<bool?>?
If true, it will remove anonymous volumes associated with the container. Defaults to true.
final
restart → Input<String?>?
The restart policy for the container. Must be one of 'no', 'on-failure', 'always', 'unless-stopped'. Defaults to no.
final
rm → Input<bool?>?
If true, then the container will be automatically removed when it exits. Defaults to false.
final
runtime → Input<String?>?
Runtime to use for the container.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
securityOpts → Input<List<String>?>?
List of string values to customize labels for MLS systems, such as SELinux. See https://docs.docker.com/engine/reference/run/#security-configuration.
final
shmSize → Input<int?>?
Size of /dev/shm in MBs.
final
start → Input<bool?>?
If true, then the Docker container will be started after creation. If false, then the container is only created. Defaults to true.
final
stdinOpen → Input<bool?>?
If true, keep STDIN open even if not attached (docker run -i). Defaults to false.
final
stopSignal → Input<String?>?
Signal to stop a container (default SIGTERM).
final
stopTimeout → Input<int?>?
Timeout (in seconds) to stop a container.
final
storageOpts → Input<Map<String, String>?>?
Key/value pairs for the storage driver options, e.g. size: 120G
final
sysctls → Input<Map<String, String>?>?
A map of kernel parameters (sysctls) to set in the container.
final
tmpfs → Input<Map<String, String>?>?
A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options.
final
tty → Input<bool?>?
If true, allocate a pseudo-tty (docker run -t). Defaults to false.
final
ulimits → Input<List<ContainerUlimit>?>?
Ulimit options to add.
final
uploads → Input<List<ContainerUpload>?>?
Specifies files to upload to the container before starting it. Only one of content or contentBase64 can be set and at least one of them has to be set.
final
user → Input<String?>?
User used for run the first process. Format is user or user:group which user and group can be passed literally or by name.
final
usernsMode → Input<String?>?
Sets the usernamespace mode for the container when usernamespace remapping option is enabled.
final
volumes → Input<List<ContainerVolume>?>?
Spec for mounting volumes in the container.
final
wait → Input<bool?>?
If true, then the Docker container is waited for being healthy state after creation. This requires your container to have a healthcheck, otherwise this provider will error. If false, then the container health state is not checked. Defaults to false.
final
waitTimeout → Input<int?>?
The timeout in seconds to wait the container to be healthy after creation. Defaults to 60.
final
workingDir → Input<String?>?
The working directory for commands to run in.
final

Methods

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

Operators

operator ==(Object other) → bool
The equality operator.
inherited