Delete stopped containers Run in API Explorer

POST /containers/prune

Query parameters

  • filters string

    Filters to process on the prune list, encoded as JSON (a map[string][]string).

    Available filters:

    • until=<timestamp> Prune containers created before this timestamp. The <timestamp> can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. 10m, 1h30m) computed relative to the daemon machine’s time.
    • label (label=<key>, label=<key>=<value>, label!=<key>, or label!=<key>=<value>) Prune containers with (or without, in case label!=... is used) the specified labels.

Responses

  • 200 application/json

    No error

    Hide response attributes Show response attributes object
    • ContainersDeleted array[string]

      Container IDs that were deleted

    • SpaceReclaimed integer(int64)

      Disk space reclaimed in bytes

  • 500 application/json

    Server error

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

POST /containers/prune
curl \
 --request POST 'http://api.example.com/v1.44/containers/prune'
Response examples (200)
{
  "ContainersDeleted": [
    "string"
  ],
  "SpaceReclaimed": 42
}
Response examples (500)
{
  "message": "Something went wrong."
}
Response examples (500)
{
  "message": "Something went wrong."
}