#!/bin/bash
imageid=(`docker images |grep -v REPOSITORY|awk '{print $3}'`)
image=(`docker images |grep -v REPOSITORY|awk '{print $1}'|sed -s 's/hub.cloudak47.com/192.168.1.170/g'`)
for ((i=0;i<${#imageid[@]};i++))
do
docker tag ${imageid[i]} ${image[i]}
docker push ${image[i]}
done
转载于:https://www.cnblogs.com/zjd2626/p/7326006.html