<commit_before>---
title: Tag Pruning
description: Skip the management headache of deciding which tags to delete or preserve by configuring a tag pruning policy or enforcing a tag limit per repository in the Docker Trusted Registry
keywords: registry, tag pruning, tag limit, repo management
---

> BETA DISCLAIMER
>
> This is beta content. It is not yet complete and should be considered a work in progress. This content is subject to change without notice.

## Overview

You can configure the Docker Trusted Registry (DTR) to automatically clean up repository 
images which are abandoned and no longer necessary. You can accomplish tag pruning on each 
repository that you manage by:

* specifying a tag pruning policy (#specifying-a-tag-pruning-policy)
* enforcing a tag limit (#enforcing-a-tag-limit)

## Specify a tag pruning policy

You can now add tag pruning policies on each repository that you manage. To get started, navigate to `https://<dtr-url>` and log in with your credentials.
 
Select **Repositories** on the left navigation pane, and then click on the name of the repository
that you want to update. Note that you will have to click on the repository name following the
the `/` after the specific namespace for your repository.

![tag pruning](../../images/tag-pruning-0.png){: .with-border}

Select the **Pruning** tab, and click **New pruning policy** to specify your tag pruning criteria:

![](../../images/tag-pruning-1.png){: .with-border}


DTR allows you to set your pruning triggers based on the following image attributes:

| Name            | Description                                        |
|:----------------|:---------------------------------------------------|
| Tag name        | Whether the tag name equals, starts with, ends with, contains, is one of, or is not one of your specified string values |
| Component name  | Whether the image has a given component and the component name equals, starts with, ends with, contains, is one of, or is not one of your specified string values |
| Vulnerabilities | Whether the image has vulnerabilities &endash; critical, major, minor, or all &endash; and your selected vulnerability filter is greater than or equals, greater than, equals, not equals, less than or equals, or less than your specified number |
| License         | Whether the image uses an intellectual property license and is one of or not one of your specified words 
| Last updated at | Whether the last image update was before your specified number of hours, days, weeks, or months |  

Specify one or more image attributes to your pruning criteria, and choose **Prune future tags** or **Prune all tags**. Upon selection, you will see a confirmation message and will be redirected to your newly updated **Pruning** tab. 

![](../../images/tag-pruning-2.png){: .with-border}


If you have specified multiple pruning policies on the repository, the **Pruning** tab will display a list of your prune triggers and details on when a tag pruning was performed based on the trigger, a toggle for deactivating or reactivating the trigger, and a **View** link for modifying or deleting your selected trigger.

![](../../images/tag-pruning-3.png){: .with-border}<commit_msg>Update tag-pruning.md<commit_after>---
title: Tag Pruning
description: Skip the management headache of deciding which tags to delete or preserve by configuring a tag pruning policy or enforcing a tag limit per repository in the Docker Trusted Registry
keywords: registry, tag pruning, tag limit, repo management
---

> BETA DISCLAIMER
>
> This is beta content. It is not yet complete and should be considered a work in progress. This content is subject to change without notice.

## Overview

You can configure the Docker Trusted Registry (DTR) to automatically clean up repository 
images which are abandoned and no longer necessary. You enable tag pruning on each 
repository that you manage by:

* [specifying a tag pruning policy] (#specify-a-tag-pruning-policy)
* [enforcing a tag limit] (#enforce-a-tag-limit)

## Specify a tag pruning policy

You can now add tag pruning policies on each repository that you manage. To get started, navigate to `https://<dtr-url>` and log in with your credentials.
 
Select **Repositories** on the left navigation pane, and then click on the name of the repository
that you want to update. Note that you will have to click on the repository name following
the `/` after the specific namespace for your repository.

![tag pruning](../../images/tag-pruning-0.png){: .with-border}

Select the **Pruning** tab, and click **New pruning policy** to specify your tag pruning criteria:

![](../../images/tag-pruning-1.png){: .with-border}


DTR allows you to set your pruning triggers based on the following image attributes:

| Name            | Description                                        |
|:----------------|:---------------------------------------------------|
| Tag name        | Whether the tag name equals, starts with, ends with, contains, is one of, or is not one of your specified string values |
| Component name  | Whether the image has a given component and the component name equals, starts with, ends with, contains, is one of, or is not one of your specified string values |
| Vulnerabilities | Whether the image has vulnerabilities &endash; critical, major, minor, or all &endash; and your selected vulnerability filter is greater than or equals, greater than, equals, not equals, less than or equals, or less than your specified number |
| License         | Whether the image uses an intellectual property license and is one of or not one of your specified words 
| Last updated at | Whether the last image update was before your specified number of hours, days, weeks, or months |  

Specify one or more image attributes to your pruning criteria, and choose **Prune future tags** or **Prune all tags**. Upon selection, you will see a confirmation message and will be redirected to your newly updated **Pruning** tab. 

![](../../images/tag-pruning-2.png){: .with-border}


If you have specified multiple pruning policies on the repository, the **Pruning** tab will display a list of your prune triggers and details on when a tag pruning operation was performed based on the trigger, a toggle for deactivating or reactivating the trigger, and a **View** link for modifying or deleting your selected trigger.

![](../../images/tag-pruning-3.png){: .with-border}
{'fraction_non_alphanumeric': 0.09360908101383922, 'fraction_numerical': 0.0012439744985227803, 'mean_word_length': 3.526389866291344, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2749993', 'n_tokens_mistral': 1603, 'n_tokens_neox': 1522, 'n_words': 897}