Delete builder cache Run in API Explorer

POST /build/prune

Query parameters

  • keep-storage integer(int64)

    Amount of disk space in bytes to keep for cache

  • all boolean

    Remove all types of build cache

  • filters string

    A JSON encoded value of the filters (a map[string][]string) to process on the list of build cache objects.

    Available filters:

    • until=<timestamp> remove cache older than <timestamp>. The <timestamp> can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. 10m, 1h30m) computed relative to the daemon's local time.
    • id=<id>
    • parent=<id>
    • type=<string>
    • description=<string>
    • inuse
    • shared
    • private

Responses

  • 200 application/json

    No error

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

      ID of build cache object

    • 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 /build/prune
curl \
 --request POST 'http://api.example.com/v1.44/build/prune'
Response examples (200)
{
  "CachesDeleted": [
    "string"
  ],
  "SpaceReclaimed": 42
}
Response examples (500)
{
  "message": "Something went wrong."
}
Response examples (500)
{
  "message": "Something went wrong."
}