Search or ask Docker

Resize an exec instance

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

View Markdown
POST/exec/{id}/resize
Resize the TTY session used by an exec instance. This endpoint only works if tty was specified as part of creating and starting the exec instance.

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

Exec instance ID

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

application/json

Response 200

No error

text/plain

Response 400

bad parameter

application/json

Schema: ErrorResponse

Schema example

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

Response 404

No such exec instance

application/json

Schema: ErrorResponse

Schema example

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

Response 500

Server error

application/json

Schema: ErrorResponse

Schema example

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

Referenced schemas

#/components/schemas/ErrorResponse

Complete operation contract
{
  "description": "Resize the TTY session used by an exec instance. This endpoint only works\nif `tty` was specified as part of creating and starting the exec instance.\n",
  "operationId": "ExecResize",
  "parameters": [
    {
      "description": "Exec instance ID",
      "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": {
      "content": {
        "application/json": {},
        "text/plain": {}
      },
      "description": "No error"
    },
    "400": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "bad parameter"
    },
    "404": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "No such exec instance"
    },
    "500": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "Server error"
    }
  },
  "summary": "Resize an exec instance",
  "tags": [
    "Exec"
  ]
}