How to delete image from Azure Container Registry

后端 未结 8 937
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-29 09:13

Is there a way to delete specific tags only? I only found a way to delete the whole registry using the REST/cli-acr

Thanks

相关标签:
8条回答
  • 2020-12-29 09:37

    Here is a powershell script that deletes all Azure Container Registry tags except for tags MyTag1 and MyTag2:

    az acr repository show-tags -n MyRegistry --repository MyRepository | ConvertFrom-String | %{$_.P2 -replace "[`",]",""} | where {$_ -notin "MyTag1","MyTag2"  } | % {az acr repository delete -n MyRegistry --repository MyRepository --tag $_ --yes}
    

    It uses Azure CLI 2.0.

    0 讨论(0)
  • 2020-12-29 09:46

    UPDATE COPIED FROM BELOW:

    As an update, today we've released a preview of several features including repository delete, Individual Azure Active Directory Logins and Webhooks.

    Original answer:

    We are hardening up the registry for our GA release later this month. We've deferred all new features while we focus on performance, reliability and additional azure data centers, delivering ACR across all public data centers by GA. We will provide deleting of images and tags in a future release. We're started to use https://github.com/Azure/acr/ to track features and bugs. Delete is captured here: https://github.com/Azure/acr/issues/33

    Thanks for the feedback, Steve

    0 讨论(0)
提交回复
热议问题