从私服上下载,那么这些镜像需要先push到私服上

pull_images_on_node.sh:
  1. #!/bin/sh
  2. ROOT=$(cd `dirname $0`/../&&pwd)
  3. pushd $ROOT/install
  4. # docker pull images of calico
  5. sh docker_pull.sh quay.io/calico/node:v2.5.1
  6. sh docker_pull.sh quay.io/calico/cni:v1.10.0
  7. sh docker_pull.sh quay.io/calico/kube-policy-controller:v0.7.0
  8. # docker pull images of kube-dns
  9. sh docker_pull.sh gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64:v1.14.1
  10. sh docker_pull.sh gcr.io/google_containers/k8s-dns-kube-dns-amd64:v1.14.1
  11. sh docker_pull.sh gcr.io/google_containers/k8s-dns-sidecar-amd64:v1.14.1
  12. # docker pull images of dashboard
  13. sh docker_pull.sh gcr.io/google_containers/kubernetes-dashboard-amd64:v1.6.0
  14. # docker pull images of consul
  15. sh docker_pull.sh consul:0.8.4
  16. popd

docker_pull.sh
  1. #!/bin/sh
  2. IP=$G_DOCKER_REGISTRY
  3. IMAGE=`docker images |awk -F ' ' '{print $1":"$2}' |grep $1`
  4. if [ "$IMAGE" = "$1" ];then
  5. echo "$1 exist"
  6. exit
  7. fi
  8. docker pull $IP/$1
  9. docker tag $IP/$1 $1
  10. docker rmi $IP/$1