ContainerState

@Serializable
data class ContainerState(val status: ContainerState.Status? = null, val running: Boolean? = null, val paused: Boolean? = null, val restarting: Boolean? = null, val ooMKilled: Boolean? = null, val dead: Boolean? = null, val pid: Int? = null, val exitCode: Int? = null, val error: String? = null, val startedAt: String? = null, val finishedAt: String? = null, val health: Health? = null)

ContainerState stores container's running state. It's part of ContainerJSONBase and will be returned by the \"inspect\" command.

Parameters

status

String representation of the container state. Can be one of \"created\", \"running\", \"paused\", \"restarting\", \"removing\", \"exited\", or \"dead\".

running

Whether this container is running. Note that a running container can be paused. The Running and Paused booleans are not mutually exclusive: When pausing a container (on Linux), the freezer cgroup is used to suspend all processes in the container. Freezing the process requires the process to be running. As a result, paused containers are both Running and Paused. Use the Status field instead to determine if a container's state is \"running\".

paused

Whether this container is paused.

restarting

Whether this container is restarting.

ooMKilled

Whether a process within this container has been killed because it ran out of memory since the container was last started.

dead
pid

The process ID of this container

exitCode

The last exit code of this container

error
startedAt

The time when this container was last started.

finishedAt

The time when this container last exited.

health

Constructors

Link copied to clipboard
constructor(status: ContainerState.Status? = null, running: Boolean? = null, paused: Boolean? = null, restarting: Boolean? = null, ooMKilled: Boolean? = null, dead: Boolean? = null, pid: Int? = null, exitCode: Int? = null, error: String? = null, startedAt: String? = null, finishedAt: String? = null, health: Health? = null)

Types

Link copied to clipboard
@Serializable
enum Status : Enum<ContainerState.Status>

String representation of the container state. Can be one of \"created\", \"running\", \"paused\", \"restarting\", \"removing\", \"exited\", or \"dead\".

Properties

Link copied to clipboard
@SerialName(value = "Dead")
val dead: Boolean?
Link copied to clipboard
@SerialName(value = "Error")
val error: String?
Link copied to clipboard
@SerialName(value = "ExitCode")
val exitCode: Int?
Link copied to clipboard
@SerialName(value = "FinishedAt")
val finishedAt: String?
Link copied to clipboard
@SerialName(value = "Health")
val health: Health?
Link copied to clipboard
@SerialName(value = "OOMKilled")
val ooMKilled: Boolean?
Link copied to clipboard
@SerialName(value = "Paused")
val paused: Boolean?
Link copied to clipboard
@SerialName(value = "Pid")
val pid: Int?
Link copied to clipboard
@SerialName(value = "Restarting")
val restarting: Boolean?
Link copied to clipboard
@SerialName(value = "Running")
val running: Boolean?
Link copied to clipboard
@SerialName(value = "StartedAt")
val startedAt: String?
Link copied to clipboard
@SerialName(value = "Status")
val status: ContainerState.Status?