You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
552 B

2 years ago
#!/bin/bash
HTTPS_PROXY=$1
IMAGE_REGISTRY=$2
IMAGE_REGISTRY_USER=$3
2 years ago
IMAGES=$(kubeadm config images list | grep k8s.gcr.io)
2 years ago
for IMAGE in ${IMAGES[@]}
do
echo "pull image ${IMAGE}"
https_proxy=${HTTPS_PROXY} ctr images pull --all-platforms ${IMAGE}
IMAGE_NAME=$(echo ${IMAGE}|sed -e 's|.*/||g')
ctr images tag ${IMAGE} ${IMAGE_REGISTRY}/${IMAGE_NAME}
ctr images push -k -u ${IMAGE_REGISTRY_USER} ${IMAGE_REGISTRY}/${IMAGE_NAME}
# ctr images rm ${IMAGE}
done
#192.168.0.144:1080 ccr.ccs.tencentyun.com/kgcrio 100004225373:Hello2022