/v2/registry/{registry_name}/garbage-collectionDeprecatedStart Garbage Collection
Note: This endpoint is deprecated. Please use the /v2/registries endpoint instead.
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/registry/$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.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
A 401 is returned: Authentication failed due to invalid credentials. A 404 is returned: The resource was not found. A 429 is returned: The API rate limit has been exceeded. A 500 is returned: There was a server error. Any other status is an error: There was an unexpected error.