Created
September 27, 2018 09:39
-
-
Save eloylp/de598ab0315c3dceb3259333cf146e04 to your computer and use it in GitHub Desktop.
A simple script for moving your entire registry to other.
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 | |
# You must be logged in both registries before. | |
SOURCE_REGISTRY_IMAGES=( | |
your.source.registry/namespace1/subnamespace1/image1:tag | |
your.source.registry/namespace1/subnamespace1/image2:tag | |
) | |
DESTINATION_REGISTRY_NAMESPACE="your.destination.registry/namespace/subnamespace" | |
for i in ${SOURCE_REGISTRY_IMAGES[*]}; do | |
image=$(echo -n $i | rev | cut -d "/" -f1 | rev ) | |
docker pull $i | |
docker tag $i $DESTINATION_REGISTRY_NAMESPACE/$image | |
docker push $DESTINATION_REGISTRY_NAMESPACE/$image | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment