kubeadm docker镜像拉取脚本

2021/7/18 6:07:35

本文主要是介绍kubeadm docker镜像拉取脚本,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

  

 

#!/bin/bash

images=($(kubeadm config images list))

for image in ${images[*]};do
	echo -e "\e[7mdownload $image\e[0m"
	if [[ $image =~ coredns ]];then
		image_=coredns:${image##*v}
		echo $image_ $image
		docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/$image_
		docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/$image_ $image
		docker image rm registry.cn-hangzhou.aliyuncs.com/google_containers/$image_
	else
		image=${image#*/}
		echo $image
		docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/$image
		docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/$image k8s.gcr.io/$image
		docker image rm registry.cn-hangzhou.aliyuncs.com/google_containers/$image
	fi
done

  



这篇关于kubeadm docker镜像拉取脚本的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程