All Products
Search
Document Center

Container Registry:Delete image tags

Last Updated:May 27, 2026

Accumulated image tags from repeated builds consume OSS storage and incur additional costs. You can configure tag retention policies to bulk-delete image tags from Container Registry Enterprise Edition instances.

Configure a tag retention policy

Image tags that fall outside the retention policy are deleted.

  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, choose Repository > Tags.

  6. On the Tags page, click Create Retention Policy.

  7. In the Create Retention Policy dialog box, configure the parameters in the Cleanup Scope step and click Next.

    Parameter

    Description

    Cleanup Scope

    Clean up image tags by Instance, Namespace, or Repository.

    • Instance: Cleans up all repositories in the instance. Only tags matching the retention rules are kept.

    • Namespace: Cleans up all repositories in the namespace. Only tags matching the retention rules are kept.

    • Repository: Cleans up a specific repository within a namespace.

      Note

      If you select Repository and then select only a namespace without specifying a repository, all repositories in that namespace are cleaned up.

    Trigger Type

    How tag deletion tasks run.

    Trigger Cycle

    Schedule for automatic execution: Every Week or Every Month.

    Note

    This parameter is required only when Trigger Type is set to Automatic.

  8. In the Retention Policy step, configure the parameters and click Create Retention Policy.

    Parameter

    Description

    Keep recently pushed images

    Required. Specify how many recently pushed images to keep.

    Keep image tags

    Optional. Specify additional image tag patterns to keep beyond the recently pushed count.

    Note

    Defaults to .* (retain all tags beyond the recently pushed count).

Manually trigger tag deletion tasks

  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, choose Repository > Tags.

  6. On the Tags page, find the target tag retention policy and click Execute in the Actions column.

  7. In the Tips dialog box, click Confirm.

What to do next

Deleted image tags still occupy OSS storage. To free this space, run artifact deletion tasks. Clean up OSS buckets.