Skip to content

Instantly share code, notes, and snippets.

@yhu-ctrl
Created February 18, 2021 13:04
Show Gist options
  • Save yhu-ctrl/6d94359d8a3f1af28e7165eeb2454df0 to your computer and use it in GitHub Desktop.
Save yhu-ctrl/6d94359d8a3f1af28e7165eeb2454df0 to your computer and use it in GitHub Desktop.
从国内镜像站拉取k8s所需镜像,并重命名
#!/bin/bash
images_list=`kubeadm config images list`
mirrors_url='registry.cn-hangzhou.aliyuncs.com/google_containers'
for need_image in $images_list; do
down_image="$mirrors_url/${need_image##*/}"
docker pull $down_image
docker tag $down_image $need_image
docker rmi $down_image
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment