#!/bin/bash
set -x 

newrepo=dockerhub.kubekey.local:7443/kubesphere
oldrepo=registry.cn-beijing.aliyuncs.com/koordinator-sh

dockerimages=(
koordlet:v1.6.0
koord-descheduler:v1.6.0
koord-manager:v1.6.0
koord-scheduler:v1.6.0
)

j=1
for i in ${dockerimages[@]}
do
    echo $i
    echo $j

    docker pull $oldrepo/$i
    docker tag $oldrepo/$i $newrepo/$i
#    docker rmi $i $newrepo/$i

    let j+=1
done

docker save $newrepo/koordlet:v1.6.0 $newrepo/koord-descheduler:v1.6.0 $newrepo/koord-manager:v1.6.0 $newrepo/koord-scheduler:v1.6.0 -o koordinator.tar
set +x

