Last active
December 27, 2024 00:19
-
-
Save rcastill/96308fe9f78a298d99c593cb6770f00b to your computer and use it in GitHub Desktop.
Get a list of all repositories repo:tag in an azure container registry ACR using azure-cli az azcli and save them to tags_ACR.txt
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
| # Example usage: | |
| # $ ACR=someregistry bash acrlookup.sh | |
| # repo1:latest | |
| # repo1:0.1.0 | |
| # repo2:latest | |
| # $ cat tags_someregistry.txt | |
| # repo1:latest | |
| # repo1:0.1.0 | |
| # repo2:latest | |
| set -x | |
| # example: someregistry | |
| ACR="${ACR:-}" | |
| # execute up to CONCURRENT_PROCS concurrently | |
| CONCURRENT_PROCS="${PROCS:-16}" | |
| # list all repositories in $ACR | |
| # execute $CONCURRENT_PROCS concurrent show-tags processes over retrieved repositories | |
| az acr repository list -n "$ACR" -o tsv \ | |
| | xargs --max-procs "$CONCURRENT_PROCS" -IREPO bash -c 'az acr repository show-tags -n '$ACR' -o tsv --repository REPO | while read tag; do echo REPO:$tag; done' \ | |
| | tee "tags_$ACR.txt" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment