Search or ask Docker

List processes running inside a container

GET /containers/{id}/top — Docker Engine API 1.57.

View Markdown
GET/containers/{id}/top
On Unix systems, this is done by running the ps command. This endpoint is not supported on Windows.

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"
}

ps_args query

The arguments to pass to ps. For example, aux

Type: string

All schema constraints and annotations
{
  "default": "-ef",
  "type": "string"
}

Request and responses

Response 200

no error

application/json

Schema: ContainerTopResponse

Response 200

no error

text/plain

Schema: ContainerTopResponse

Response 404

no such container

application/json

Schema: ErrorResponse

Example

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

Response 500

server error

application/json

Schema: ErrorResponse

Schema example

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

Referenced schemas

#/components/schemas/ContainerTopResponse

#/components/schemas/ErrorResponse

Complete operation contract
{
  "description": "On Unix systems, this is done by running the `ps` command. This endpoint\nis not supported on Windows.\n",
  "operationId": "ContainerTop",
  "parameters": [
    {
      "description": "ID or name of the container",
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "The arguments to pass to `ps`. For example, `aux`",
      "in": "query",
      "name": "ps_args",
      "schema": {
        "default": "-ef",
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ContainerTopResponse"
          }
        },
        "text/plain": {
          "schema": {
            "$ref": "#/components/schemas/ContainerTopResponse"
          }
        }
      },
      "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": "server error"
    }
  },
  "summary": "List processes running inside a container",
  "tags": [
    "Container"
  ]
}