kubesphere是国内优秀的基于kubernetes开发的适合国内使用的k8s集群软件,部署简单,操作简单。为了进一步提高本地搭建测试效率,尝试将其安装部署中的各种容器放置到本地harbor仓库中。

拿到kubesphere需要的容器镜像名称

使用该链接,在Linuux上安装的离线安装部分,包含所有容器镜像内容
截图_选择区域_20231102142530.png

容器镜像内容

  images:
  - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-apiserver:v1.23.15
  - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-controller-manager:v1.23.15
  - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-proxy:v1.23.15
  - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-scheduler:v1.23.15
  - registry.cn-beijing.aliyuncs.com/kubesphereio/pause:3.6
  - registry.cn-beijing.aliyuncs.com/kubesphereio/coredns:1.8.6
  - registry.cn-beijing.aliyuncs.com/kubesphereio/cni:v3.23.2
  - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-controllers:v3.23.2
  - registry.cn-beijing.aliyuncs.com/kubesphereio/node:v3.23.2
  - registry.cn-beijing.aliyuncs.com/kubesphereio/pod2daemon-flexvol:v3.23.2
  - registry.cn-beijing.aliyuncs.com/kubesphereio/typha:v3.23.2
  - registry.cn-beijing.aliyuncs.com/kubesphereio/flannel:v0.12.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/provisioner-localpv:3.3.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/linux-utils:3.3.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/haproxy:2.3
  - registry.cn-beijing.aliyuncs.com/kubesphereio/nfs-subdir-external-provisioner:v4.0.2
  - registry.cn-beijing.aliyuncs.com/kubesphereio/k8s-dns-node-cache:1.15.12
  - registry.cn-beijing.aliyuncs.com/kubesphereio/ks-installer:v3.4.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/ks-apiserver:v3.4.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/ks-console:v3.4.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/ks-controller-manager:v3.4.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/kubectl:v1.22.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/kubectl:v1.21.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/kubectl:v1.20.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/kubefed:v0.8.1
  - registry.cn-beijing.aliyuncs.com/kubesphereio/tower:v0.2.1
  - registry.cn-beijing.aliyuncs.com/kubesphereio/minio:RELEASE.2019-08-07T01-59-21Z
  - registry.cn-beijing.aliyuncs.com/kubesphereio/mc:RELEASE.2019-08-07T23-14-43Z
  - registry.cn-beijing.aliyuncs.com/kubesphereio/snapshot-controller:v4.0.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/nginx-ingress-controller:v1.1.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/defaultbackend-amd64:1.4
  - registry.cn-beijing.aliyuncs.com/kubesphereio/metrics-server:v0.4.2
  - registry.cn-beijing.aliyuncs.com/kubesphereio/redis:5.0.14-alpine
  - registry.cn-beijing.aliyuncs.com/kubesphereio/haproxy:2.0.25-alpine
  - registry.cn-beijing.aliyuncs.com/kubesphereio/alpine:3.14
  - registry.cn-beijing.aliyuncs.com/kubesphereio/openldap:1.3.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/netshoot:v1.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/cloudcore:v1.13.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/iptables-manager:v1.13.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/edgeservice:v0.3.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/gatekeeper:v3.5.2
  - registry.cn-beijing.aliyuncs.com/kubesphereio/openpitrix-jobs:v3.3.2
  - registry.cn-beijing.aliyuncs.com/kubesphereio/devops-apiserver:ks-v3.4.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/devops-controller:ks-v3.4.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/devops-tools:ks-v3.4.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/ks-jenkins:v3.4.0-2.319.3-1
  - registry.cn-beijing.aliyuncs.com/kubesphereio/inbound-agent:4.10-2
  - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-base:v3.2.2
  - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-nodejs:v3.2.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-maven:v3.2.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-maven:v3.2.1-jdk11
  - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-python:v3.2.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-go:v3.2.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-go:v3.2.2-1.16
  - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-go:v3.2.2-1.17
  - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-go:v3.2.2-1.18
  - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-base:v3.2.2-podman
  - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-nodejs:v3.2.0-podman
  - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-maven:v3.2.0-podman
  - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-maven:v3.2.1-jdk11-podman
  - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-python:v3.2.0-podman
  - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-go:v3.2.0-podman
  - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-go:v3.2.2-1.16-podman
  - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-go:v3.2.2-1.17-podman
  - registry.cn-beijing.aliyuncs.com/kubesphereio/builder-go:v3.2.2-1.18-podman
  - registry.cn-beijing.aliyuncs.com/kubesphereio/s2ioperator:v3.2.1
  - registry.cn-beijing.aliyuncs.com/kubesphereio/s2irun:v3.2.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/s2i-binary:v3.2.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/tomcat85-java11-centos7:v3.2.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/tomcat85-java11-runtime:v3.2.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/tomcat85-java8-centos7:v3.2.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/tomcat85-java8-runtime:v3.2.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/java-11-centos7:v3.2.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/java-8-centos7:v3.2.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/java-8-runtime:v3.2.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/java-11-runtime:v3.2.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/nodejs-8-centos7:v3.2.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/nodejs-6-centos7:v3.2.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/nodejs-4-centos7:v3.2.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/python-36-centos7:v3.2.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/python-35-centos7:v3.2.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/python-34-centos7:v3.2.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/python-27-centos7:v3.2.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/argocd:v2.3.3
  - registry.cn-beijing.aliyuncs.com/kubesphereio/argocd-applicationset:v0.4.1
  - registry.cn-beijing.aliyuncs.com/kubesphereio/dex:v2.30.2
  - registry.cn-beijing.aliyuncs.com/kubesphereio/redis:6.2.6-alpine
  - registry.cn-beijing.aliyuncs.com/kubesphereio/configmap-reload:v0.7.1
  - registry.cn-beijing.aliyuncs.com/kubesphereio/prometheus:v2.39.1
  - registry.cn-beijing.aliyuncs.com/kubesphereio/prometheus-config-reloader:v0.55.1
  - registry.cn-beijing.aliyuncs.com/kubesphereio/prometheus-operator:v0.55.1
  - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-rbac-proxy:v0.11.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-state-metrics:v2.6.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/node-exporter:v1.3.1
  - registry.cn-beijing.aliyuncs.com/kubesphereio/alertmanager:v0.23.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/thanos:v0.31.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/grafana:8.3.3
  - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-rbac-proxy:v0.11.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/notification-manager-operator:v2.3.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/notification-manager:v2.3.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/notification-tenant-sidecar:v3.2.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/elasticsearch-curator:v5.7.6
  - registry.cn-beijing.aliyuncs.com/kubesphereio/elasticsearch-oss:6.8.22
  - registry.cn-beijing.aliyuncs.com/kubesphereio/opensearch:2.6.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/opensearch-dashboards:2.6.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/opensearch-curator:v0.0.5
  - registry.cn-beijing.aliyuncs.com/kubesphereio/fluentbit-operator:v0.14.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/docker:19.03
  - registry.cn-beijing.aliyuncs.com/kubesphereio/fluent-bit:v1.9.4
  - registry.cn-beijing.aliyuncs.com/kubesphereio/log-sidecar-injector:v1.2.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/filebeat:6.7.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-events-operator:v0.6.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-events-exporter:v0.6.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-events-ruler:v0.6.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-auditing-operator:v0.2.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-auditing-webhook:v0.2.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/pilot:1.14.6
  - registry.cn-beijing.aliyuncs.com/kubesphereio/proxyv2:1.14.6
  - registry.cn-beijing.aliyuncs.com/kubesphereio/jaeger-operator:1.29
  - registry.cn-beijing.aliyuncs.com/kubesphereio/jaeger-agent:1.29
  - registry.cn-beijing.aliyuncs.com/kubesphereio/jaeger-collector:1.29
  - registry.cn-beijing.aliyuncs.com/kubesphereio/jaeger-query:1.29
  - registry.cn-beijing.aliyuncs.com/kubesphereio/jaeger-es-index-cleaner:1.29
  - registry.cn-beijing.aliyuncs.com/kubesphereio/kiali-operator:v1.50.1
  - registry.cn-beijing.aliyuncs.com/kubesphereio/kiali:v1.50
  - registry.cn-beijing.aliyuncs.com/kubesphereio/busybox:1.31.1
  - registry.cn-beijing.aliyuncs.com/kubesphereio/nginx:1.14-alpine
  - registry.cn-beijing.aliyuncs.com/kubesphereio/wget:1.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/hello:plain-text
  - registry.cn-beijing.aliyuncs.com/kubesphereio/wordpress:4.8-apache
  - registry.cn-beijing.aliyuncs.com/kubesphereio/hpa-example:latest
  - registry.cn-beijing.aliyuncs.com/kubesphereio/fluentd:v1.4.2-2.0
  - registry.cn-beijing.aliyuncs.com/kubesphereio/perl:latest
  - registry.cn-beijing.aliyuncs.com/kubesphereio/examples-bookinfo-productpage-v1:1.16.2
  - registry.cn-beijing.aliyuncs.com/kubesphereio/examples-bookinfo-reviews-v1:1.16.2
  - registry.cn-beijing.aliyuncs.com/kubesphereio/examples-bookinfo-reviews-v2:1.16.2
  - registry.cn-beijing.aliyuncs.com/kubesphereio/examples-bookinfo-details-v1:1.16.2
  - registry.cn-beijing.aliyuncs.com/kubesphereio/examples-bookinfo-ratings-v1:1.16.3
  - registry.cn-beijing.aliyuncs.com/kubesphereio/scope:1.13.0

使用脚本将kubesphereio/scope等类似的镜像名称整理成bash shell脚本中的数组

cat a.txt | awk -F\/ '{print $3}' | awk -F\: '{print "\"kubesphereio/"$1"\""}' | tr '\n' " "
"kubesphereio/kube-apiserver" "kubesphereio/kube-controller-manager" "kubesphereio/kube-proxy" "kubesphereio/kube-scheduler" "kubesphereio/pause" "kubesphereio/coredns" "kubesphereio/cni" "kubesphereio/kube-controllers" "kubesphereio/node" "kubesphereio/pod2daemon-flexvol" "kubesphereio/typha" "kubesphereio/flannel" "kubesphereio/provisioner-localpv" "kubesphereio/linux-utils" "kubesphereio/haproxy" "kubesphereio/nfs-subdir-external-provisioner" "kubesphereio/k8s-dns-node-cache" "kubesphereio/ks-installer" "kubesphereio/ks-apiserver" "kubesphereio/ks-console" "kubesphereio/ks-controller-manager" "kubesphereio/kubectl" "kubesphereio/kubectl" "kubesphereio/kubectl" "kubesphereio/kubefed" "kubesphereio/tower" "kubesphereio/minio" "kubesphereio/mc" "kubesphereio/snapshot-controller" "kubesphereio/nginx-ingress-controller" "kubesphereio/defaultbackend-amd64" "kubesphereio/metrics-server" "kubesphereio/redis" "kubesphereio/haproxy" "kubesphereio/alpine" "kubesphereio/openldap" "kubesphereio/netshoot" "kubesphereio/cloudcore" "kubesphereio/iptables-manager" "kubesphereio/edgeservice" "kubesphereio/gatekeeper" "kubesphereio/openpitrix-jobs" "kubesphereio/devops-apiserver" "kubesphereio/devops-controller" "kubesphereio/devops-tools" "kubesphereio/ks-jenkins" "kubesphereio/inbound-agent" "kubesphereio/builder-base" "kubesphereio/builder-nodejs" "kubesphereio/builder-maven" "kubesphereio/builder-maven" "kubesphereio/builder-python" "kubesphereio/builder-go" "kubesphereio/builder-go" "kubesphereio/builder-go" "kubesphereio/builder-go" "kubesphereio/builder-base" "kubesphereio/builder-nodejs" "kubesphereio/builder-maven" "kubesphereio/builder-maven" "kubesphereio/builder-python" "kubesphereio/builder-go" "kubesphereio/builder-go" "kubesphereio/builder-go" "kubesphereio/builder-go" "kubesphereio/s2ioperator" "kubesphereio/s2irun" "kubesphereio/s2i-binary" "kubesphereio/tomcat85-java11-centos7" "kubesphereio/tomcat85-java11-runtime" "kubesphereio/tomcat85-java8-centos7" "kubesphereio/tomcat85-java8-runtime" "kubesphereio/java-11-centos7" "kubesphereio/java-8-centos7" "kubesphereio/java-8-runtime" "kubesphereio/java-11-runtime" "kubesphereio/nodejs-8-centos7" "kubesphereio/nodejs-6-centos7" "kubesphereio/nodejs-4-centos7" "kubesphereio/python-36-centos7" "kubesphereio/python-35-centos7" "kubesphereio/python-34-centos7" "kubesphereio/python-27-centos7" "kubesphereio/argocd" "kubesphereio/argocd-applicationset" "kubesphereio/dex" "kubesphereio/redis" "kubesphereio/configmap-reload" "kubesphereio/prometheus" "kubesphereio/prometheus-config-reloader" "kubesphereio/prometheus-operator" "kubesphereio/kube-rbac-proxy" "kubesphereio/kube-state-metrics" "kubesphereio/node-exporter" "kubesphereio/alertmanager" "kubesphereio/thanos" "kubesphereio/grafana" "kubesphereio/kube-rbac-proxy" "kubesphereio/notification-manager-operator" "kubesphereio/notification-manager" "kubesphereio/notification-tenant-sidecar" "kubesphereio/elasticsearch-curator" "kubesphereio/elasticsearch-oss" "kubesphereio/opensearch" "kubesphereio/opensearch-dashboards" "kubesphereio/opensearch-curator" "kubesphereio/fluentbit-operator" "kubesphereio/docker" "kubesphereio/fluent-bit" "kubesphereio/log-sidecar-injector" "kubesphereio/filebeat" "kubesphereio/kube-events-operator" "kubesphereio/kube-events-exporter" "kubesphereio/kube-events-ruler" "kubesphereio/kube-auditing-operator" "kubesphereio/kube-auditing-webhook" "kubesphereio/pilot" "kubesphereio/proxyv2" "kubesphereio/jaeger-operator" "kubesphereio/jaeger-agent" "kubesphereio/jaeger-collector" "kubesphereio/jaeger-query" "kubesphereio/jaeger-es-index-cleaner" "kubesphereio/kiali-operator" "kubesphereio/kiali" "kubesphereio/busybox" "kubesphereio/nginx" "kubesphereio/wget" "kubesphereio/hello" "kubesphereio/wordpress" "kubesphereio/hpa-example" "kubesphereio/fluentd" "kubesphereio/perl" "kubesphereio/examples-bookinfo-productpage-v1" "kubesphereio/examples-bookinfo-reviews-v1" "kubesphereio/examples-bookinfo-reviews-v2" "kubesphereio/examples-bookinfo-details-v1" "kubesphereio/examples-bookinfo-ratings-v1" "kubesphereio/scope"

准备额脚本内容

#!/bin/bash
harbor1="registry.cn-beijing.aliyuncs.com"
harbor2="harbor.sddts.cn"
docker login -u admin -p "123" harbor.sddts.cn

projects=("kubesphereio/kube-apiserver" "kubesphereio/kube-controller-manager" "kubesphereio/kube-proxy" "kubesphereio/kube-scheduler" "kubesphereio/pause" "kubesphereio/coredns" "kubesphereio/cni" "kubesphereio/kube-controllers" "kubesphereio/node" "kubesphereio/pod2daemon-flexvol" "kubesphereio/typha" "kubesphereio/flannel" "kubesphereio/provisioner-localpv" "kubesphereio/linux-utils" "kubesphereio/haproxy" "kubesphereio/nfs-subdir-external-provisioner" "kubesphereio/k8s-dns-node-cache" "kubesphereio/ks-installer" "kubesphereio/ks-apiserver" "kubesphereio/ks-console" "kubesphereio/ks-controller-manager" "kubesphereio/kubectl" "kubesphereio/kubectl" "kubesphereio/kubectl" "kubesphereio/kubefed" "kubesphereio/tower" "kubesphereio/minio" "kubesphereio/mc" "kubesphereio/snapshot-controller" "kubesphereio/nginx-ingress-controller" "kubesphereio/defaultbackend-amd64" "kubesphereio/metrics-server" "kubesphereio/redis" "kubesphereio/haproxy" "kubesphereio/alpine" "kubesphereio/openldap" "kubesphereio/netshoot" "kubesphereio/cloudcore" "kubesphereio/iptables-manager" "kubesphereio/edgeservice" "kubesphereio/gatekeeper" "kubesphereio/openpitrix-jobs" "kubesphereio/devops-apiserver" "kubesphereio/devops-controller" "kubesphereio/devops-tools" "kubesphereio/ks-jenkins" "kubesphereio/inbound-agent" "kubesphereio/builder-base" "kubesphereio/builder-nodejs" "kubesphereio/builder-maven" "kubesphereio/builder-maven" "kubesphereio/builder-python" "kubesphereio/builder-go" "kubesphereio/builder-go" "kubesphereio/builder-go" "kubesphereio/builder-go" "kubesphereio/builder-base" "kubesphereio/builder-nodejs" "kubesphereio/builder-maven" "kubesphereio/builder-maven" "kubesphereio/builder-python" "kubesphereio/builder-go" "kubesphereio/builder-go" "kubesphereio/builder-go" "kubesphereio/builder-go" "kubesphereio/s2ioperator" "kubesphereio/s2irun" "kubesphereio/s2i-binary" "kubesphereio/tomcat85-java11-centos7" "kubesphereio/tomcat85-java11-runtime" "kubesphereio/tomcat85-java8-centos7" "kubesphereio/tomcat85-java8-runtime" "kubesphereio/java-11-centos7" "kubesphereio/java-8-centos7" "kubesphereio/java-8-runtime" "kubesphereio/java-11-runtime" "kubesphereio/nodejs-8-centos7" "kubesphereio/nodejs-6-centos7" "kubesphereio/nodejs-4-centos7" "kubesphereio/python-36-centos7" "kubesphereio/python-35-centos7" "kubesphereio/python-34-centos7" "kubesphereio/python-27-centos7" "kubesphereio/argocd" "kubesphereio/argocd-applicationset" "kubesphereio/dex" "kubesphereio/redis" "kubesphereio/configmap-reload" "kubesphereio/prometheus" "kubesphereio/prometheus-config-reloader" "kubesphereio/prometheus-operator" "kubesphereio/kube-rbac-proxy" "kubesphereio/kube-state-metrics" "kubesphereio/node-exporter" "kubesphereio/alertmanager" "kubesphereio/thanos" "kubesphereio/grafana" "kubesphereio/kube-rbac-proxy" "kubesphereio/notification-manager-operator" "kubesphereio/notification-manager" "kubesphereio/notification-tenant-sidecar" "kubesphereio/elasticsearch-curator" "kubesphereio/elasticsearch-oss" "kubesphereio/opensearch" "kubesphereio/opensearch-dashboards" "kubesphereio/opensearch-curator" "kubesphereio/fluentbit-operator" "kubesphereio/docker" "kubesphereio/fluent-bit" "kubesphereio/log-sidecar-injector" "kubesphereio/filebeat" "kubesphereio/kube-events-operator" "kubesphereio/kube-events-exporter" "kubesphereio/kube-events-ruler" "kubesphereio/kube-auditing-operator" "kubesphereio/kube-auditing-webhook" "kubesphereio/pilot" "kubesphereio/proxyv2" "kubesphereio/jaeger-operator" "kubesphereio/jaeger-agent" "kubesphereio/jaeger-collector" "kubesphereio/jaeger-query" "kubesphereio/jaeger-es-index-cleaner" "kubesphereio/kiali-operator" "kubesphereio/kiali" "kubesphereio/busybox" "kubesphereio/nginx" "kubesphereio/wget" "kubesphereio/hello" "kubesphereio/wordpress" "kubesphereio/hpa-example" "kubesphereio/fluentd" "kubesphereio/perl" "kubesphereio/examples-bookinfo-productpage-v1" "kubesphereio/examples-bookinfo-reviews-v1" "kubesphereio/examples-bookinfo-reviews-v2" "kubesphereio/examples-bookinfo-details-v1" "kubesphereio/examples-bookinfo-ratings-v1" "kubesphereio/scope")
if [ ! -e /bin/docker-ls ]; then
  wget https://vip.123pan.cn/1815238395/download/docker-ls/docker-ls-linux-amd64.zip -O /tmp/docker-ls-linux-amd64.zip
  unzip -d /bin/ /tmp/docker-ls-linux-amd64.zip
fi

for project in "${projects[@]}"; do
  echo ""
  echo ""
  echo "开始新的project"
  set -x
  echo $project
  tagList=$(docker-ls tags -r https://registry.cn-beijing.aliyuncs.com $project 2>/dev/null | grep '\- ' | tr -d '"' | awk '{print $2}')
  echo "tagList is $tagList"
  tagList2=$(docker-ls tags -r https://$harbor2 -u admin -p Lab@1234 $project 2>/dev/null | grep '\- ' | tr -d '"' | awk '{print $2}')
  echo "tagList2 is $tagList2"
  for tag in $tagList; do
    if [ "$tag" == "latest" ]; then
      echo "发现latest TAG标签"
    else
      if [ $(echo $tagList2 | grep $tag | wc -l) -eq 1 ]; then
        echo "tag $tag 已存在目标harbor中,本次跳过"
        continue
      else
        echo "tag $tag 不存在目标harbor中,本次继续"
      fi
    fi

    imageName="$project:$tag"
    imageName1="$harbor1/$imageName"

    echo ""
    echo "开始进行$imageName1镜像的下载。"
    while true; do
      docker pull "$imageName1"
      if [ $? -eq 0 ]; then
        echo "下载$imageName1正常。"
        echo "开始等待1分钟"
        sleep 60
        echo "等待结束,继续赶路!"
        break
      else
        echo "下载$imageName1异常。"
        echo "开始等待3600秒"
        sleep 3600
        echo "等待1小时,继续尝试..."
      fi
    done

    imageName2="$harbor2/$imageName"
    docker tag $imageName1 $imageName2
    docker push $imageName2
    docker rmi $imageName1 $imageName2
  done
done
最后修改:2023 年 11 月 02 日
如果觉得我的文章对你有用,请随意赞赏