/containers/{id}/wait Connection and access
API connection and authentication guidance
/v1.57
No HTTP authentication requirement is declared for this operation. Transport access controls can still apply.
Parameters
id
path
Required
Type:
string
All schema constraints and annotations
{
"type": "string"
}condition
query
Wait until a container state reaches the given condition.
Defaults to not-running if omitted or empty.
Type:
string
All schema constraints and annotations
{
"default": "not-running",
"enum": [
"not-running",
"next-exit",
"removed"
],
"type": "string"
}Request and responses
Response
200
application/json
Schema:
ContainerWaitResponse
Response
400
application/json
Schema:
ErrorResponse
Schema example
{
"message": "Something went wrong."
}Response
404
application/json
Schema:
ErrorResponse
Example
{
"message": "No such container: c2ada9df5af8"
}Response
500
application/json
Schema:
ErrorResponse
Schema example
{
"message": "Something went wrong."
}Referenced schemas
#/components/schemas/ContainerWaitResponse
#/components/schemas/ErrorResponse
Complete operation contract
{
"description": "Block until a container stops, then returns the exit code.",
"operationId": "ContainerWait",
"parameters": [
{
"description": "ID or name of the container",
"in": "path",
"name": "id",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "Wait until a container state reaches the given condition.\n\nDefaults to `not-running` if omitted or empty.\n",
"in": "query",
"name": "condition",
"schema": {
"default": "not-running",
"enum": [
"not-running",
"next-exit",
"removed"
],
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ContainerWaitResponse"
}
}
},
"description": "The container has exit."
},
"400": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "bad parameter"
},
"404": {
"content": {
"application/json": {
"example": {
"message": "No such container: c2ada9df5af8"
},
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "no such container"
},
"500": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "server error"
}
},
"summary": "Wait for a container",
"tags": [
"Container"
]
}