Skip to content

Instantly share code, notes, and snippets.

@typhoonzero
Created September 1, 2018 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save typhoonzero/7a72e1fd74bc943bb4800f52ea379633 to your computer and use it in GitHub Desktop.
Save typhoonzero/7a72e1fd74bc943bb4800f52ea379633 to your computer and use it in GitHub Desktop.
#!/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