Created
November 19, 2023 18:26
-
-
Save pditommaso/819e0489af174b9291103c2362fb41d4 to your computer and use it in GitHub Desktop.
Copy all container images from one repo to another
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 | |
# Source and destination repositories | |
source_repo="quay.io/seqeralabs/nf-launcher" | |
dest_repo="public.ecr.aws/seqera-labs/tower/nf-launcher" | |
# List all images in the source repository | |
tags=$(skopeo list-tags docker://$source_repo | jq -r .Tags[]) | |
# Loop through each image and perform the copy | |
for tag in $tags; do | |
# Pull from the source repository | |
source=$source_repo:$tag | |
docker pull $source | |
# Tag with the destination repository | |
target="${source/$source_repo/$dest_repo}" | |
docker tag $source $target | |
# Push to the destination repository | |
docker push $target | |
docker rmi $source | |
docker rmi $target | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment