#!/bin/bash
set -x 

newrepo=dockerhub.kubekey.local:7443/kubesphere
oldrepo=ghcr.io/chaos-mesh

dockerimages=(
chaos-daemon:v2.6.7
chaos-dashboard:v2.6.7
chaos-mesh:v2.6.7
chaos-coredns:v0.2.6
)

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/chaos-daemon:v2.6.7 $newrepo/chaos-dashboard:v2.6.7 $newrepo/chaos-mesh:v2.6.7 $newrepo/chaos-coredns:v0.2.6 -o chaos-mesh.tar
set +x

