feat: pull-k8s-image.sh supports containerd

This commit is contained in:
liuxuewen 2022-06-07 19:14:02 +08:00 committed by GitHub
parent 84b78cd83b
commit d8bcab16bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 2 deletions

View File

@ -5,5 +5,16 @@ mirror_img=$(echo ${k8s_img}|
sed 's/k8s\.gcr\.io/anjia0532\/google-containers/g;s/gcr\.io/anjia0532/g;s/\//\./g;s/ /\n/g;s/anjia0532\./anjia0532\//g' |
uniq)
sudo docker pull ${mirror_img}
sudo docker tag ${mirror_img} ${k8s_img}
if [ -x "$(command -v docker)" ]; then
sudo docker pull ${mirror_img}
sudo docker tag ${mirror_img} ${k8s_img}
exit 0
fi
if [ -x "$(command -v ctr)" ]; then
sudo ctr image pull docker.io/${mirror_img}
sudo ctr image tag docker.io/${mirror_img} ${k8s_img}
exit 0
fi
echo "command not found:docker or ctr"