Created
September 1, 2018 06:19
-
-
Save typhoonzero/7a72e1fd74bc943bb4800f52ea379633 to your computer and use it in GitHub Desktop.
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 | |
image="paddlepaddle/paddle" | |
tags=`wget -q https://registry.hub.docker.com/v1/repositories/${image}/tags -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}'` | |
if [ -n "$2" ] | |
then | |
tags=` echo "${tags}" | grep "$2" ` | |
fi | |
echo $tags | |
#IFS='\n' read -r -a array <<< "$tags" | |
#$echo "${array[1]}" | |
for tag in $tags | |
do | |
echo "processing hub.baidubce.com/paddlepaddle/paddle:$tag" | |
docker pull paddlepaddle/paddle:$tag | |
docker tag paddlepaddle/paddle:$tag hub.baidubce.com/paddlepaddle/paddle:$tag | |
docker login --username=paddlepaddle --password="work@paddle123" hub.baidubce.com | |
docker push hub.baidubce.com/paddlepaddle/paddle:$tag | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment