Created
February 24, 2021 05:10
-
-
Save zawyelwin/5f9cfa41132780a4ba1c17c76f01ab39 to your computer and use it in GitHub Desktop.
Script to import azure container registry images with tags to another 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 | |
registryName='<REGISTRY_NAME>' | |
repository=("apm/pinpoint-agent", "apm/pinpoint-collector") | |
sourceAcrName="<SOURCE_ACR_NAME>" | |
destAcrName="<DESTINATION_ACR_NAME>" | |
for repo in "${repository[@]}" | |
do | |
tags=$(az acr repository show-tags --name $sourceAcrName --repository $repo | xargs | tr -d '[]\n\r,' ) | |
for i in $tags; | |
do | |
echo "Importing $repo:$i to $destAcrName from $sourceAcrName" | |
az acr import --name $destAcrName --source <SOURCE_ACR_URL>/$repo:$i --image $repo:$i | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment