DigitalOcean-public.v2-new_Container Registries

[Public Preview] Start Garbage Collection

Garbage collection enables users to clear out unreferenced blobs (layer & manifest data) after deleting one or more manifests from a repository. If there are no unreferenced blobs resulting from the deletion of one or more manifests, garbage collection is effectively a noop. See here for more information about how and why you should clean up your container registry periodically.

To request a garbage collection run on your registry, send a POST request to /v2/registries/$REGISTRY_NAME/garbage-collection. This will initiate the following sequence of events on your registry.

  • Set the registry to read-only mode, meaning no further write-scoped JWTs will be issued to registry clients. Existing write-scoped JWTs will continue to work until they expire which can take up to 15 minutes.
  • Wait until all existing write-scoped JWTs have expired.
  • Scan all registry manifests to determine which blobs are unreferenced.
  • Delete all unreferenced blobs from the registry.
  • Record the number of blobs deleted and bytes freed, mark the garbage collection status as success.
  • Remove the read-only mode restriction from the registry, meaning write-scoped JWTs will once again be issued to registry clients.
post/v2/registries/{registry_name}/garbage-collection

Path parameters

registry_namestring required

The name of a container registry.

Response

The response will be a JSON object with a key of garbage_collection. This will be a json object with attributes representing the currently-active garbage collection.

Example response

{
  "garbage_collection": {
    "uuid": "eff0feee-49c7-4e8f-ba5c-a320c109c8a8",
    "registry_name": "example",
    "status": "requested",
    "created_at": "2020-10-30T21:03:24Z",
    "updated_at": "2020-10-30T21:03:44Z",
    "blobs_deleted": 42,
    "freed_bytes": 667
  }
}

Changes

Changed in 4 of the 8 revisions of this API.16

    • the security scope registry:update was added to the endpoint's security scheme bearer_auth

      api-security-scope-added

    • the security scope registry:create was removed from the endpoint's security scheme bearer_auth

      api-security-scope-removed

    • api tag DigitalOcean-public.v2-new_Container Registries added

      api-tag-added

    • api tag Container Registries removed

      api-tag-removed

    This revision also has 3 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • endpoint added

      endpoint-added

    This revision also has 70 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • api path removed without deprecation

      api-path-removed-without-deprecation

    This revision also has 436 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • endpoint added

      endpoint-added

    This revision also has 70 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog