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< ? command, Input<String> ?>String?> ? containerLogs, Input<int?> ? containerReadRefreshTimeoutMilliseconds, Input<int?> ? cpuPeriod, Input<int?> ? cpuQuota, Input<String?> ? cpuSet, Input<String?> ? cpus, Input<int?> ? destroyGraceSeconds, Input<List< ? deviceCgroupRules, Input<String> ?>List< ? deviceReadBps, Input<ContainerDeviceReadBp> ?>List< ? deviceReadIops, Input<ContainerDeviceReadIop> ?>List< ? deviceRequests, Input<ContainerDeviceRequest> ?>List< ? deviceWriteBps, Input<ContainerDeviceWriteBp> ?>List< ? deviceWriteIops, Input<ContainerDeviceWriteIop> ?>List< ? devices, Input<ContainerDevice> ?>List< ? dns, Input<String> ?>List< ? dnsOpts, Input<String> ?>List< ? dnsSearches, Input<String> ?>String?> ? domainname, Input<List< ? entrypoints, Input<String> ?>List< ? envs, Input<String> ?>int?> ? exitCode, Input<String?> ? gpus, Input<List< ? groupAdds, Input<String> ?>ContainerHealthcheck?> ? healthcheck, Input<String?> ? hostname, Input<List< ? hosts, Input<ContainerHost> ?>String?> ? image, Input<bool?> ? init, Input<String?> ? ipcMode, Input<List< ? labels, Input<ContainerLabel> ?>String?> ? logDriver, Input<Map< ? logOpts, Input<String, String> ?>bool?> ? logs, Input<int?> ? maxRetryCount, Input<int?> ? memory, Input<int?> ? memoryReservation, Input<int?> ? memorySwap, Input<List< ? mounts, Input<ContainerMount> ?>bool?> ? mustRun, Input<String?> ? name, Input<List< ? networkDatas, Input<ContainerNetworkData> ?>String?> ? networkMode, Input<List< ? networksAdvanced, Input<ContainerNetworksAdvanced> ?>String?> ? pidMode, Input<String?> ? platform, Input<List< ? ports, Input<ContainerPort> ?>bool?> ? privileged, Input<bool?> ? publishAllPorts, Input<bool?> ? readOnly, Input<bool?> ? removeVolumes, Input<String?> ? restart, Input<bool?> ? rm, Input<String?> ? runtime, Input<List< ? securityOpts, Input<String> ?>int?> ? shmSize, Input<bool?> ? start, Input<bool?> ? stdinOpen, Input<String?> ? stopSignal, Input<int?> ? stopTimeout, Input<Map< ? storageOpts, Input<String, String> ?>Map< ? sysctls, Input<String, String> ?>Map< ? tmpfs, Input<String, String> ?>bool?> ? tty, Input<List< ? ulimits, Input<ContainerUlimit> ?>List< ? uploads, Input<ContainerUpload> ?>String?> ? user, Input<String?> ? usernsMode, Input<List< ? volumes, Input<ContainerVolume> ?>bool?> ? wait, Input<int?> ? waitTimeout, Input<String?> ? workingDir}) -
Creates a new ContainerState.
attachIftrueattach to the container after its creation and waits the end of its execution. Defaults tofalse.bridgeThe network bridge of the container as read from its NetworkSettings.capabilitiesAdd or drop certain linux capabilities.cgroupParentOptional parent cgroup for the containercgroupnsModeCgroup namespace mode to use for the container. Possible values are:private,host.commandThe command to use to start the container. For example, to run/usr/bin/myprogram -f baz.confset the command to be["/usr/bin/myprogram","-f","baz.conf"].containerLogsThe logs of the container if its execution is done (attachmust be disabled).containerReadRefreshTimeoutMillisecondsThe total number of milliseconds to wait for the container to reach status 'running'cpuPeriodSpecify the CPU CFS scheduler period (in microseconds), which is used alongsidecpu-quota. Is ignored ifcpusis set.cpuQuotaImpose a CPU CFS quota on the container (in microseconds). The number of microseconds percpu-periodthat the container is limited to before throttled. Is ignored ifcpusis set.cpuSetA comma-separated list or hyphen-separated range of CPUs a container can use, e.g.0-1.cpuSharesCPU shares (relative weight) for the container.cpusSpecify 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 overcpuPeriodandcpuQuota.destroyGraceSecondsIf defined will attempt to stop the container before destroying. Container will be destroyed afternseconds or on successful stop.deviceCgroupRulesCgroup rules to allow access to classes of devices without binding specific device nodes.deviceReadBpsLimit read rate (bytes per second) from a device. This is the equivalent to repeating--device-read-bpsfordocker run.deviceReadIopsLimit read rate (IO per second) from a device. This is the equivalent to repeating--device-read-iopsfordocker run.deviceRequestsDevice requests for the container, such as CDI devices (e.g.,nvidia.com/gpu=all) or GPU requests. This is the equivalent to using the--deviceflag for CDI devices indocker run.deviceWriteBpsLimit write rate (bytes per second) to a device. This is the equivalent to repeating--device-write-bpsfordocker run.deviceWriteIopsLimit write rate (IO per second) to a device. This is the equivalent to repeating--device-write-iopsfordocker run.devicesBind traditional devices to the container (e.g.,/dev/nvidia0). For CDI devices, usedeviceRequestsinstead.dnsDNS servers to use.dnsOptsDNS options used by the DNS provider(s), seeresolv.confdocumentation for valid list of options.dnsSearchesDNS search domains that are used when bare unqualified hostnames are used inside of the container.domainnameDomain name of the container.entrypointsThe 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/myprogramwhen starting a container, set the entrypoint to be"/usr/bin/myprogram"].envsEnvironment variables to set in the form ofKEY=VALUE, e.g.DEBUG=0exitCodeThe exit code of the container if its execution is done (mustRunmust be disabled).gpusGPU devices to add to the container. Supported values areallordevice=<id[,id...]>, for exampledevice=0,2ordevice=GPU-3a23c669-1f69-c64e-cf85-44e9b07e7a2a.groupAddsAdditional groups for the container userhealthcheckA test to perform to check that the container is healthyhostnameHostname of the container.hostsAdditional hosts to add to the container.imageThe ID of the image to back this container. The easiest way to get this value is to use theimageIdattribute of thedocker.RemoteImageresource as is shown in the example.initConfigured whether an init process should be injected for this container. If unset this will default to thedockerddefaults.ipcModeIPC sharing mode for the container. Possible values are:none,private,shareable,container:<name|id>orhost.labelsUser-defined key/value metadatalogDriverThe logging driver to use for the container.logOptsKey/value pairs to use as options for the logging driver.logsSave the container logs (attachmust be enabled). Defaults tofalse.maxRetryCountThe maximum amount of times to an attempt a restart whenrestartis set to 'on-failure'.memoryThe memory limit for the container in MBs.memoryReservationThe memory-resveration for the container in MBs. Defaults to 0. Allows you to specify a soft limit smaller thanmemorywhich is activated when Docker detects contention or low memory on the host machine. If you usememory-reservation, it must be set lower thanmemoryfor it to take precedence. Because it is a soft limit, it doesn't guarantee that the container doesn't exceed the limit.memorySwapThe total memory limit (memory + swap) for the container in MBs. This setting may compute to-1afterpulumi upif the target host doesn't support memory swap, when that is the case docker will use a soft limitation.mountsSpecification for mounts to be added to containers created as part of the service.mustRunIftrue, then the Docker container will be kept running. Iffalse, 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 setmustRuntofalseand this will trigger a change. Defaults totrue.nameThe name of the container.networkDatasThe data of the networks the container is connected to.networkModeNetwork mode of the container. Defaults tobridge. If your host OS is any other OS, you need to set this value explicitly, e.g.natwhen your container will be running on an Windows host. See https://docs.docker.com/engine/network/ for more information.networksAdvancedThe networks the container is attached to. This is the equivalent to the--networkoption ofdocker runpidModeThe PID (Process) Namespace mode for the container. Eithercontainer:<name|id>orhost.platformPlatform in the formatos[/arch[/variant]]used for image lookup and container runtime, for examplelinux/amd64.portsPublish a container's port(s) to the host.privilegedIftrue, the container runs in privileged mode.publishAllPortsPublish all ports of the container.readOnlyIftrue, the container will be started as readonly. Defaults tofalse.removeVolumesIftrue, it will remove anonymous volumes associated with the container. Defaults totrue.restartThe restart policy for the container. Must be one of 'no', 'on-failure', 'always', 'unless-stopped'. Defaults tono.rmIftrue, then the container will be automatically removed when it exits. Defaults tofalse.runtimeRuntime to use for the container.securityOptsList of string values to customize labels for MLS systems, such as SELinux. See https://docs.docker.com/engine/reference/run/#security-configuration.shmSizeSize of/dev/shmin MBs.startIftrue, then the Docker container will be started after creation. Iffalse, then the container is only created. Defaults totrue.stdinOpenIftrue, keep STDIN open even if not attached (docker run -i). Defaults tofalse.stopSignalSignal to stop a container (defaultSIGTERM).stopTimeoutTimeout (in seconds) to stop a container.storageOptsKey/value pairs for the storage driver options, e.g.size:120GsysctlsA map of kernel parameters (sysctls) to set in the container.tmpfsA map of container directories which should be replaced bytmpfs mounts, and their corresponding mount options.ttyIftrue, allocate a pseudo-tty (docker run -t). Defaults tofalse.ulimitsUlimit options to add.uploadsSpecifies files to upload to the container before starting it. Only one ofcontentorcontentBase64can be set and at least one of them has to be set.userUser used for run the first process. Format isuseroruser:groupwhich user and group can be passed literally or by name.usernsModeSets the usernamespace mode for the container when usernamespace remapping option is enabled.volumesSpec for mounting volumes in the container.waitIftrue, 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. Iffalse, then the container health state is not checked. Defaults tofalse.waitTimeoutThe timeout in seconds to wait the container to be healthy after creation. Defaults to60.workingDirThe working directory for commands to run in.const -
ContainerState.fromMap(Map<
String, dynamic> map) -
factory
Properties
-
attach
→ Input<
bool?> ? -
If
trueattach to the container after its creation and waits the end of its execution. Defaults tofalse.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.confset the command to be["/usr/bin/myprogram","-f","baz.conf"].final -
containerLogs
→ Input<
String?> ? -
The logs of the container if its execution is done (
attachmust 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 ifcpusis set.final -
cpuQuota
→ Input<
int?> ? -
Impose a CPU CFS quota on the container (in microseconds). The number of microseconds per
cpu-periodthat the container is limited to before throttled. Is ignored ifcpusis 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
cpuPeriodandcpuQuota.final -
cpuSet
→ Input<
String?> ? -
A comma-separated list or hyphen-separated range of CPUs a container can use, e.g.
0-1.final -
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
nseconds 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-bpsfordocker run.final -
deviceReadIops
→ Input<
List< ?ContainerDeviceReadIop> ?> -
Limit read rate (IO per second) from a device. This is the equivalent to repeating
--device-read-iopsfordocker 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--deviceflag for CDI devices indocker run.final -
devices
→ Input<
List< ?ContainerDevice> ?> -
Bind traditional devices to the container (e.g.,
/dev/nvidia0). For CDI devices, usedeviceRequestsinstead.final -
deviceWriteBps
→ Input<
List< ?ContainerDeviceWriteBp> ?> -
Limit write rate (bytes per second) to a device. This is the equivalent to repeating
--device-write-bpsfordocker run.final -
deviceWriteIops
→ Input<
List< ?ContainerDeviceWriteIop> ?> -
Limit write rate (IO per second) to a device. This is the equivalent to repeating
--device-write-iopsfordocker 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.confdocumentation 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/myprogramwhen 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=0final -
exitCode
→ Input<
int?> ? -
The exit code of the container if its execution is done (
mustRunmust be disabled).final -
gpus
→ Input<
String?> ? -
GPU devices to add to the container. Supported values are
allordevice=<id[,id...]>, for exampledevice=0,2ordevice=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
imageIdattribute of thedocker.RemoteImageresource 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
dockerddefaults.final -
ipcMode
→ Input<
String?> ? -
IPC sharing mode for the container. Possible values are:
none,private,shareable,container:<name|id>orhost.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 (
attachmust be enabled). Defaults tofalse.final -
maxRetryCount
→ Input<
int?> ? -
The maximum amount of times to an attempt a restart when
restartis 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
memorywhich is activated when Docker detects contention or low memory on the host machine. If you usememory-reservation, it must be set lower thanmemoryfor 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
-1afterpulumi upif 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. Iffalse, 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 setmustRuntofalseand this will trigger a change. Defaults totrue.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.natwhen 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
--networkoption ofdocker runfinal -
pidMode
→ Input<
String?> ? -
The PID (Process) Namespace mode for the container. Either
container:<name|id>orhost.final -
platform
→ Input<
String?> ? -
Platform in the format
os[/arch[/variant]]used for image lookup and container runtime, for examplelinux/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 tofalse.final -
removeVolumes
→ Input<
bool?> ? -
If
true, it will remove anonymous volumes associated with the container. Defaults totrue.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 tofalse.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/shmin MBs.final -
start
→ Input<
bool?> ? -
If
true, then the Docker container will be started after creation. Iffalse, then the container is only created. Defaults totrue.final -
stdinOpen
→ Input<
bool?> ? -
If
true, keep STDIN open even if not attached (docker run -i). Defaults tofalse.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:120Gfinal -
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 tofalse.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
contentorcontentBase64can 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
useroruser:groupwhich 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. Iffalse, then the container health state is not checked. Defaults tofalse.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