acr-cli
acr-cli copied to clipboard
Purge behavior differs from documentation
Describe the bug When I attempted to purge untagged images using the
acr purge
--registry <Registry Name>
--filter <Repository Name>:<Regex filter>
--untagged
I received the following error Error: required flag(s) "ago" not set
. So I added --ago 0d
and the command went through, but it also deleted tagged images. My filter was set to repname:.*
as I assumed the tag filter was irrelevant when you specify the --untagged
switch. Setting the filter to repname:^$
fixed the problem, but the --untagged
is still required. Omitting this switch results in no images being deleted. Is this behaviour expected?
So the working command was
acr purge
--registry <Registry Name>
--filter <Repository Name>:^$
--ago 0d
--untagged
In our process we rely heavily on "floating tags". The simplest of docker examples is the latest
tag, this means we have a significant number of untagged manifests that it would be highly beneficial to be able to purge.
I came here with the same problem but after carefully reading the documentation twice, I realized that the --untagged
parameter does not mean that it would delete only untagged images. It is meant to delete untagged images if they are available.
--untagged
- Specifies that manifests that don't have associated tags (untagged manifests) are deleted.
Still, I believe many of us read that documentation to find a way to purge only untagged images, not deleting all images. I would suggest that Microsoft update that doc to show how to purge only untagged images.
Exactly this. This needs to be clarified in the documentation and we need some information on how to only delete untagged manifests, but leave the tags in place.
I have the same problem.
I believe many of us read that documentation to find a way to purge only untagged images, not deleting all images.
I believe so too.
@timja or @Wwwsylvia, can anyone take a look at this? The issue is nearly 2 years old.
I’m pretty sure we do this via configuration in the registry, you can tell it do delete unstaffed manifests after x days
My workaround on this is to set --ago=99999d
.