1.先写出镜像名及tag的文件(同一仓库)
b.txt
atf:17 base:49 dm:46 eit:70 ints:6 mis:19 tda:10 tom:22 tra:23 utility-service:latest vatrep:80 xxljob:latest rpt:latest redis:latest
2.写shell脚本拉镜像改tag推镜像
b.sh
其中value="${1%%:*}" 为截取变量,以:为分隔符取左边
#!/bin/bash value="${1%%:*}" echo $value docker pull nexus.goldwind.com.cn:9000/prod/middleware/deloitte/$1 docker tag nexus.goldwind.com.cn:9000/prod/middleware/deloitte/$1 harbor.goldwind.com/shuiwu/$value:latest docker push harbor.goldwind.com/shuiwu/$value:latest
3.执行脚本
for i in `cat b.txt`;do sh b.sh $i ;done
标签:goldwind,value,tag,镜像,com,latest From: https://www.cnblogs.com/xiaoxiaomuyuyu/p/17881860.html