Created
October 20, 2019 23:01
-
-
Save ederparaiso/45073fac54509b3ebc718b57803265b3 to your computer and use it in GitHub Desktop.
Purge untagged container images in Azure Container Registry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# WARNING! This script deletes data! | |
# Purge untagged (orphaned) images | |
REGISTRY=your_registry | |
REPOSITORY=your_repository | |
az acr repository show-manifests --name $REGISTRY --repository $REPOSITORY --query "[?tags[0]==null].digest" -o tsv \ | |
| xargs --replace=digest --verbose az acr repository delete -n $REGISTRY --image $REPOSITORY@digest --yes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment