Last active
April 24, 2022 08:33
-
-
Save benc-uk/9441e2658a3605be79382dc77bb3bbd6 to your computer and use it in GitHub Desktop.
Docker & Containers
This file contains hidden or 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 | |
# | |
# Removes all matching tags from an ACR repo | |
# params: {acr-name} {image-repository} {tag} | |
# | |
az acr repository show-tags -n $1 --repository $2 -o tsv | while read img ; do | |
if [[ $img = *"$3"* ]]; then | |
echo "Deleting image $2:$img ..." | |
az acr repository delete -n $1 --image $2:$img --yes | |
fi | |
done |
This file contains hidden or 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
alias docker-prune='docker container prune -f && docker image prune -f && docker volume prune -f && docker buildx prune -f' | |
alias docker-clean='docker rm -f $(docker ps -a -q)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment