docker 批量修改tag
docker images | grep goharbor | sed 's/goharbor/192.168.30.10\/gohorbor/g' | awk '{print "docker tag"" " $3" "$1":"$2}'|sh
docker images | grep iregistry | sed 's/iregistry.baidu-int.com/registry.can6.com:5000\/baidu/g' | awk '{print "docker tag"" " $3" "$1":"$2}'|sh for i in `docker images|grep registry.can6.com:5000/baidu |awk '{print $1":"$2}'` do docker push $i done
批量修改
docker images|grep iregis|awk '{print $1":"$2}'|while read image; do new_images=$(echo $image|sed s); docker tag $image $new_images; done 批量推送
docker images |grep "10443/baidu" |awk '{print $1":"$2}'|xargs -i docker push {} &