增加镜像拉取和上传脚本
parent
d05a27a124
commit
e0c299265f
|
@ -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
|
Loading…
Reference in New Issue