Skip to main content

Add a tag retention rule

Tag retention rules let you define criteria to automatically retain or delete tags in a repository, giving you control over storage usage without manual intervention.

  1. On the FPT Portal menu, select Container Registry > Policy tab.

    Policy tab on Container Registry

  2. Click ADD RULES and enter the information to create a tag retention rule.

    Tag retention rule creation form

  3. In the Repositories menu, select matching or excluding.

    matching/excluding option for repositories

  4. In the Repositories field, enter the information to identify the repositories the rule applies to:

    • A single repository name, e.g. my_repo_1
    • A comma-separated list of repositories, e.g. my_repo_1, my_repo_2
    • Repository names with wildcard characters

    Repository configuration example

    Use ** to apply to all repositories. If you select matching, the rule applies to the repositories you specify. If you select excluding, the rule applies to all except the repositories you specify.

  5. In the By image count or number of days menu, specify the number of tags to retain or the retention period.

    Count or period retention options

    OptionDescription
    retain the most recently pushed # imagesKeep the specified number of most recently pushed images
    retain the most recently pulled # imagesKeep the specified number of most recently pulled images
    retain the images pushed within the last # daysKeep images pushed within the specified number of days
    retain the images pulled within the last # daysKeep images pulled within the specified number of days
    retain alwaysAlways retain images under this rule
  6. In the Tag menu, select matching or excluding.

    matching/excluding option for tags

  7. In the Tag field, enter the information to identify the tags the rule applies to:

    • A single tag name, e.g. my_tag_1
    • A comma-separated list of tags
    • Tag names with wildcard characters

    Tag configuration example

    Use ** to apply to all tags.

  8. Click Add to save the rule.

    Add button to save the retention rule

  9. Verify the newly created tag retention rule.

    Tag retention rule creation result

    Example: a rule that retains the 20 most recently pushed artifacts across all tags in all repositories.