All Products
Search
Document Center

Container Registry:Clean up OSS buckets

Last Updated:Mar 17, 2026

Deleting image tags from a Container Registry Enterprise Edition instance does not immediately release storage in the Object Storage Service (OSS) bucket. Unreferenced image data persists until you run a garbage collection task, which removes that data and reclaims the storage capacity.

Important

Garbage collection applies to image repositories only. Expired chart tags in chart repositories are not removed from the OSS bucket.

Prerequisites

Before you begin, make sure you have:

  • A Container Registry Enterprise Edition instance

  • Verified that the image tags you plan to delete can be regenerated and pushed if needed (deleted tags cannot be recovered)

  • Stopped all operations on the OSS bucket that stores the Enterprise Edition data — do not perform any operations on that bucket during or after a garbage collection task

Step 1: Enable garbage collection

The first time you run garbage collection, you must submit a ticket to add your Alibaba Cloud account to the whitelist. This is a one-time step; subsequent tasks do not require it.

  1. Log on to the Container Registry console.

  2. In the top navigation bar, select a region.

  3. In the left-side navigation pane, click Instances.

  4. On the Instances page, click the Enterprise Edition instance you want to manage.

  5. In the left-side navigation pane of the instance, choose Instances > Garbage Collection.

  6. On the Garbage Collection page, click Execute.

  7. In the Confirmation dialog box, click Submit Ticket to enable garbage collection.

Step 2: Create a garbage collection task

After garbage collection is enabled, run a task to delete expired image tags from all image repositories in the instance. Image pulls continue to work during the task.

  1. Log on to the Container Registry console.

  2. In the top navigation bar, select a region.

  3. In the left-side navigation pane, click Instances.

  4. On the Instances page, click the Enterprise Edition instance you want to manage.

  5. In the left-side navigation pane of the instance, choose Instances > Garbage Collection.

  6. On the Garbage Collection page, click Execute.

  7. In the Confirmation message, read the precautions, select Confirm to clean up, and then click Confirm.

The system begins deleting expired image tags from all image repositories in the instance.

Verify the task and check storage results

After submitting the task, go to Instances > Garbage Collection in the left-side navigation pane to view the task status or cancel the task.

Note

After the garbage collection task completes, OSS bucket storage capacity does not decrease immediately. The decrease takes effect after a number of days determined by the lifecycle rules configured for the bucket. Check the lifecycle rules on your OSS bucket to understand when the storage change will appear.

Limitations

  • Garbage collection is supported on Container Registry Enterprise Edition instances only.

  • Expired chart tags in chart repositories are not deleted from the OSS bucket.

  • Deleted image tags cannot be recovered.

What to do next

To remove image tags without running garbage collection, configure a tag retention policy. For more information, see Delete image tags.