Merge pull request #758 from liu-xuewen/master

feat: pull-k8s-image.sh supports containerd
This commit is contained in:
AnJia 2022-06-08 08:59:45 +08:00 committed by GitHub
commit 7c2e24eb5c
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 -n k8s.io image pull docker.io/${mirror_img}
sudo ctr -n k8s.io image tag docker.io/${mirror_img} ${k8s_img}
exit 0
fi
echo "command not found:docker or ctr"