Skip to content

Instantly share code, notes, and snippets.

@pditommaso
Created November 19, 2023 18:26
Show Gist options
  • Save pditommaso/819e0489af174b9291103c2362fb41d4 to your computer and use it in GitHub Desktop.
Save pditommaso/819e0489af174b9291103c2362fb41d4 to your computer and use it in GitHub Desktop.
Copy all container images from one repo to another
#!/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