[Shell]Docker 批量tag

# 批量tag
docker images | grep metallb |awk -v OFS=':' '{print "docker tag "$1,$2" hub.leoshi.io/"$1,$2}' | sh

[root@Harbor ~]# docker images | grep metallb |awk -v OFS=':' '{print "docker tag "$1,$2" hub.leoshi.io/"$1,$2}'
docker tag quay.io/metallb/speaker:v0.12.1 hub.leoshi.io/quay.io/metallb/speaker:v0.12.1
docker tag quay.io/metallb/controller:v0.12.1 hub.leoshi.io/quay.io/metallb/controller:v0.12.1

# 批量推送
docker images | grep hbpch |awk -v OFS=':' '{print "docker push "$1,$2}' | sh
posted @ 2022-09-06 16:43  LeoShi2020  阅读(235)  评论(0编辑  收藏  举报