Delete unused images Run in API Explorer

POST /images/prune

Query parameters

  • filters string

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

    • dangling=<boolean> When set to true (or 1), prune only unused and untagged images. When set to false (or 0), all unused images are pruned.
    • until=<string> Prune images 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 images with (or without, in case label!=... is used) the specified labels.

Responses

  • 200 application/json

    No error

    Hide response attributes Show response attributes object
    • ImagesDeleted array[object]

      Images that were deleted

      Hide ImagesDeleted attributes Show ImagesDeleted attributes object
      • Untagged string

        The image ID of an image that was untagged

      • Deleted string

        The image ID of an image that was 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 /images/prune
curl \
 --request POST 'http://api.example.com/v1.49/images/prune'
Response examples (200)
{
  "ImagesDeleted": [
    {
      "Untagged": "string",
      "Deleted": "string"
    }
  ],
  "SpaceReclaimed": 42
}
Response examples (500)
{
  "message": "Something went wrong."
}
Response examples (500)
{
  "message": "Something went wrong."
}