

The container command is passed using an environment variable. This example deletes all image tags and manifests in the hello-world repository in myregistry that were modified more than 1 day ago and all untagged manifests. The following example uses the az acr run command to run the acr purge command on-demand. The -untagged filter doesn't respond to the -ago filter.įor additional parameters, run acr purge -help.Īcr purge supports other features of ACR Tasks commands including run variables and task run logs that are streamed and also saved for later retrieval. A default value is used if this parameter is not provided.

-concurrency - Specifies a number of purge tasks to process concurrently.-keep - Specifies that the latest x number of to-be-deleted tags are retained.This parameter is useful for testing a purge command to make sure it does not inadvertently delete data you intend to preserve. -dry-run - Specifies that no data is deleted, but the output is the same as if the command is run without this flag.This parameter also deletes untagged manifests in addition to tags that are already being deleted. -untagged - Specifies that all manifests that don't have associated tags ( untagged manifests) are deleted.The following two are used in examples in this article: For example, -ago 2d3h6m selects all filtered images last modified more than two days, 3 hours, and 6 minutes ago, and -ago 1.5h selects images last modified more than 1.5 hours ago.Īcr purge supports several optional parameters. Valid time units include "d" for days, "h" for hours, and "m" for minutes. The duration consists of a sequence of one or more decimal numbers, each with a unit suffix. -ago - A Go-style duration string to indicate a duration beyond which images are deleted.You can also pass multiple -filter parameters. Examples: -filter "hello-world.*" matches all tags in the hello-world repository, -filter "hello-world:^1.*" matches tags beginning with 1 in the hello-world repository, and -filter ".*/cache.*" matches all tags in the repositories ending in /cache. -filter - A repository name regular expression and a tag name regular expression to filter images in the registry.For example, run the acr purge -help as az acr run -registry -cmd 'acr purge -help' /dev/null.Īt a minimum, specify the following when you run acr purge: We recommend running the complete acr purge command to use the ACR Purge.The standard command to execute the acr purge is az acr run -registry -cmd 'acr purge -optional parameter' /dev/null.
