Search or ask Docker

Resize a container TTY

POST /containers/{id}/resize — Docker Engine API 1.57.

View Markdown
POST/containers/{id}/resize
Resize the TTY for a container.

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

ID or name of the container

Type: string

All schema constraints and annotations
{
  "type": "string"
}

h query Required

Height of the TTY session in characters

Type: integer

All schema constraints and annotations
{
  "type": "integer"
}

w query Required

Width of the TTY session in characters

Type: integer

All schema constraints and annotations
{
  "type": "integer"
}

Request and responses

Response 200

no error

No response content is declared.

Response 404

no such container

application/json

Schema: ErrorResponse

Example

{
  "message": "No such container: c2ada9df5af8"
}

Response 500

cannot resize container

application/json

Schema: ErrorResponse

Schema example

{
  "message": "Something went wrong."
}

Referenced schemas

#/components/schemas/ErrorResponse

Complete operation contract
{
  "description": "Resize the TTY for a container.",
  "operationId": "ContainerResize",
  "parameters": [
    {
      "description": "ID or name of the container",
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "Height of the TTY session in characters",
      "in": "query",
      "name": "h",
      "required": true,
      "schema": {
        "type": "integer"
      }
    },
    {
      "description": "Width of the TTY session in characters",
      "in": "query",
      "name": "w",
      "required": true,
      "schema": {
        "type": "integer"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "no error"
    },
    "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": "cannot resize container"
    }
  },
  "summary": "Resize a container TTY",
  "tags": [
    "Container"
  ],
  "x-consumes": [
    "application/octet-stream"
  ]
}