Search or ask Docker

Inspect an exec instance

GET /exec/{id}/json — Docker Engine API 1.57.

View Markdown
GET/exec/{id}/json
Return low-level information about an 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"
}

Request and responses

Response 200

No error

application/json

Type: object

CanRemove

Type: boolean

All schema constraints and annotations
{
  "type": "boolean"
}
ContainerID

Type: string

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

Type: string

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

Type: integer

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

Type: string

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

Type: boolean

All schema constraints and annotations
{
  "type": "boolean"
}
OpenStdin

Type: boolean

All schema constraints and annotations
{
  "type": "boolean"
}
OpenStdout

Type: boolean

All schema constraints and annotations
{
  "type": "boolean"
}
Pid

Type: integer

The system process ID for the exec process.
All schema constraints and annotations
{
  "description": "The system process ID for the exec process.",
  "type": "integer"
}
ProcessConfig

Schema: ProcessConfig

Running

Type: boolean

All schema constraints and annotations
{
  "type": "boolean"
}
All schema constraints and annotations
{
  "properties": {
    "CanRemove": {
      "type": "boolean"
    },
    "ContainerID": {
      "type": "string"
    },
    "DetachKeys": {
      "type": "string"
    },
    "ExitCode": {
      "type": "integer"
    },
    "ID": {
      "type": "string"
    },
    "OpenStderr": {
      "type": "boolean"
    },
    "OpenStdin": {
      "type": "boolean"
    },
    "OpenStdout": {
      "type": "boolean"
    },
    "Pid": {
      "description": "The system process ID for the exec process.",
      "type": "integer"
    },
    "ProcessConfig": {
      "$ref": "#/components/schemas/ProcessConfig"
    },
    "Running": {
      "type": "boolean"
    }
  },
  "title": "ExecInspectResponse",
  "type": "object"
}

Example

{
  "CanRemove": false,
  "ContainerID": "b53ee82b53a40c7dca428523e34f741f3abc51d9f297a14ff874bf761b995126",
  "DetachKeys": "",
  "ExitCode": 2,
  "ID": "f33bbfb39f5b142420f4759b2348913bd4a8d1a6d7fd56499cb41a1bb91d7b3b",
  "OpenStderr": true,
  "OpenStdin": true,
  "OpenStdout": true,
  "Pid": 42000,
  "ProcessConfig": {
    "arguments": [
      "-c",
      "exit 2"
    ],
    "entrypoint": "sh",
    "privileged": false,
    "tty": true,
    "user": "1000"
  },
  "Running": false
}

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

#/components/schemas/ProcessConfig

Complete operation contract
{
  "description": "Return low-level information about an exec instance.",
  "operationId": "ExecInspect",
  "parameters": [
    {
      "description": "Exec instance ID",
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "example": {
            "CanRemove": false,
            "ContainerID": "b53ee82b53a40c7dca428523e34f741f3abc51d9f297a14ff874bf761b995126",
            "DetachKeys": "",
            "ExitCode": 2,
            "ID": "f33bbfb39f5b142420f4759b2348913bd4a8d1a6d7fd56499cb41a1bb91d7b3b",
            "OpenStderr": true,
            "OpenStdin": true,
            "OpenStdout": true,
            "Pid": 42000,
            "ProcessConfig": {
              "arguments": [
                "-c",
                "exit 2"
              ],
              "entrypoint": "sh",
              "privileged": false,
              "tty": true,
              "user": "1000"
            },
            "Running": false
          },
          "schema": {
            "properties": {
              "CanRemove": {
                "type": "boolean"
              },
              "ContainerID": {
                "type": "string"
              },
              "DetachKeys": {
                "type": "string"
              },
              "ExitCode": {
                "type": "integer"
              },
              "ID": {
                "type": "string"
              },
              "OpenStderr": {
                "type": "boolean"
              },
              "OpenStdin": {
                "type": "boolean"
              },
              "OpenStdout": {
                "type": "boolean"
              },
              "Pid": {
                "description": "The system process ID for the exec process.",
                "type": "integer"
              },
              "ProcessConfig": {
                "$ref": "#/components/schemas/ProcessConfig"
              },
              "Running": {
                "type": "boolean"
              }
            },
            "title": "ExecInspectResponse",
            "type": "object"
          }
        }
      },
      "description": "No error"
    },
    "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": "Inspect an exec instance",
  "tags": [
    "Exec"
  ]
}