All Products
Search
Document Center

Container Registry:Clean up OSS buckets

Last Updated:Nov 05, 2024

A Container Registry Enterprise Edition instance allows you to enable garbage collection to delete image tags that you no longer require to release the occupied storage capacity of an Object Storage Service (OSS) bucket.

Usage notes

Important
  • Before you create a garbage collection task, carefully read the instructions in the documentation and the Container Registry console.

  • Image tags cannot be recovered after they are deleted. Before you delete image tags, make sure that the key images can be regenerated and pushed.

  • Do not perform any operation on the OSS bucket that stores the Container Registry Enterprise Edition data during or after a garbage collection task.

Step 1: Enable garbage collection

To enable garbage collection, perform the following steps:

  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 that you want to manage.

  5. On the management page of the Container Registry Enterprise Edition 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.

    Important

    The first time you perform a garbage collection task, click Submit Ticket in the Confirmation dialog box to add your Alibaba Cloud account to the whitelist. You do not need to repeat this operation after garbage collection is enabled.

Step 2: Create a garbage collection task

Note
  • You can still pull images from image repositories during the garbage collection task.

  • You can perform garbage collection tasks only for Container Registry Enterprise Edition instances. When you perform a single garbage collection task on a Container Registry Enterprise Edition instance, expired image tags in all image repositories are deleted from the OSS bucket. Expired chart tags in all chart repositories are not deleted from OSS buckets.

Perform the following steps to create a garbage collection 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 that you want to manage.

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

  6. On the Garbage Collection page, click Execute. In the Confirmation message that appears, read the precautions, select Confirm to clean up, and click Confirm to create a garbage collection task.

Result

  • In the left-side navigation pane of the Container Registry Enterprise Edition instance, choose Instances > Garbage Collection to view or cancel the garbage collection task that you created.

  • After the garbage collection task is complete, the storage capacity of the OSS bucket does not change immediately. The storage capacity changes after a specific number of days based on the lifecycle rules configured for the bucket.