增加镜像拉取和上传脚本

pull/41/head
Jimmy Song 2017-08-01 21:45:05 +08:00
parent d05a27a124
commit e0c299265f
1 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,13 @@
#!/bin/bash
repo=sz-pg-oam-docker-hub-001.tendcloud.com/library/
cat $1|while read line
do
docker pull $line
old_name=`echo $line|cut -d ":" -f1`
tag=`echo $line|cut -d ":" -f2`
new_name=$repo`echo $old_name|cut -d "/" -f1`-`echo $old_name|cut -d "/" -f2`:$tag
echo "Change $line => $new_name"
id=`docker images|grep $old_name|tr -s " "|cut -d " " -f3`
docker tag $id $new_name
docker push $new_name
done