Created
April 18, 2021 15:12
-
-
Save k8scat/0414c6661c5e211b6327cd77fcd864c6 to your computer and use it in GitHub Desktop.
Pull K8S images - v1.21.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Pull K8S images | |
# Version: 1.21.0 | |
# Maintainer: [email protected] | |
set -e | |
# Pull images from aliyun registry | |
kubeadm config images list | sed -e 's/^/docker pull /g' -e 's#k8s.gcr.io#registry.cn-shenzhen.aliyuncs.com/k8scat#g' -e 's#/coredns/coredns#/coredns#g' | sh -x | |
# Tag images | |
docker images | grep k8scat | awk '{print "docker tag",$1":"$2,$1":"$2}' | sed -e 's#registry.cn-shenzhen.aliyuncs.com/k8scat#k8s.gcr.io#2' | sh -x | |
docker tag k8s.gcr.io/coredns:v1.8.0 k8s.gcr.io/coredns/coredns:v1.8.0 | |
# Remove images | |
docker images | grep k8scat | awk '{print "docker rmi",$1":"$2}' | sh -x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment