imdingtalk / image-mirror

Synchronize images from any public repository to ACR to speed up image pulling
Apache License 2.0
76 stars 190 forks source link

[image-mirror] #392

Closed LiTeng51 closed 3 months ago

LiTeng51 commented 3 months ago

docker.io/kubesphere/pause:3.9 docker.io/kubesphere/kube-apiserver:v1.28.8 docker.io/kubesphere/kube-controller-manager:v1.28.8 docker.io/kubesphere/kube-scheduler:v1.28.8 docker.io/kubesphere/kube-proxy:v1.28.8 docker.io/coredns/coredns:1.9.3 docker.io/kubesphere/k8s-dns-node-cache:1.22.20 docker.io/calico/kube-controllers:v3.27.3 docker.io/calico/cni:v3.27.3 docker.io/calico/node:v3.27.3 docker.io/calico/pod2daemon-flexvol:v3.27.3 docker.io/calico/typha:v3.27.3 docker.io/flannel/flannel:v0.21.3 docker.io/flannel/flannel-cni-plugin:v1.1.2 docker.io/cilium/cilium:v1.15.3 docker.io/cilium/operator-generic:v1.15.3 docker.io/hybridnetdev/hybridnet:v0.8.6 docker.io/kubeovn/kube-ovn:v1.10.10 docker.io/kubesphere/multus-cni:v3.8 docker.io/openebs/provisioner-localpv:3.3.0 docker.io/openebs/linux-utils:3.3.0 docker.io/library/haproxy:2.9.6-alpine docker.io/plndr/kube-vip:v0.7.2 docker.io/kubesphere/kata-deploy:stable docker.io/kubesphere/node-feature-discovery:v0.10.0 kubesphere/ks-installer:v3.4.1 kubesphere/ks-apiserver:v3.4.1 kubesphere/ks-console:v3.4.1 kubesphere/ks-controller-manager:v3.4.1 kubesphere/kubectl:v1.20.0 kubesphere/kubefed:v0.8.1 kubesphere/tower:v0.2.1 minio/minio:RELEASE.2019-08-07T01-59-21Z minio/mc:RELEASE.2019-08-07T23-14-43Z csiplugin/snapshot-controller:v4.0.0 kubesphere/nginx-ingress-controller:v1.3.1 mirrorgooglecontainers/defaultbackend-amd64:1.4 kubesphere/metrics-server:v0.4.2 redis:5.0.14-alpine haproxy:2.0.25-alpine alpine:3.14 osixia/openldap:1.3.0 kubesphere/netshoot:v1.0 kubeedge/cloudcore:v1.13.0 kubesphere/iptables-manager:v1.13.0 kubesphere/edgeservice:v0.3.0 openpolicyagent/gatekeeper:v3.5.2 kubesphere/openpitrix-jobs:v3.3.2 kubesphere/devops-apiserver:ks-v3.4.1 kubesphere/devops-controller:ks-v3.4.1 kubesphere/devops-tools:ks-v3.4.1 kubesphere/ks-jenkins:v3.4.0-2.319.3-1 jenkins/inbound-agent:4.10-2 kubesphere/builder-base:v3.2.2 kubesphere/builder-nodejs:v3.2.0 kubesphere/builder-maven:v3.2.0 kubesphere/builder-maven:v3.2.1-jdk11 kubesphere/builder-python:v3.2.0 kubesphere/builder-go:v3.2.0 kubesphere/builder-go:v3.2.2-1.16 kubesphere/builder-go:v3.2.2-1.17 kubesphere/builder-go:v3.2.2-1.18 kubesphere/builder-base:v3.2.2-podman kubesphere/builder-nodejs:v3.2.0-podman kubesphere/builder-maven:v3.2.0-podman kubesphere/builder-maven:v3.2.1-jdk11-podman kubesphere/builder-python:v3.2.0-podman kubesphere/builder-go:v3.2.0-podman kubesphere/builder-go:v3.2.2-1.16-podman kubesphere/builder-go:v3.2.2-1.17-podman kubesphere/builder-go:v3.2.2-1.18-podman kubesphere/s2ioperator:v3.2.1 kubesphere/s2irun:v3.2.0 kubesphere/s2i-binary:v3.2.0 kubesphere/tomcat85-java11-centos7:v3.2.0 kubesphere/tomcat85-java11-runtime:v3.2.0 kubesphere/tomcat85-java8-centos7:v3.2.0 kubesphere/tomcat85-java8-runtime:v3.2.0 kubesphere/java-11-centos7:v3.2.0 kubesphere/java-8-centos7:v3.2.0 kubesphere/java-8-runtime:v3.2.0 kubesphere/java-11-runtime:v3.2.0 kubesphere/nodejs-8-centos7:v3.2.0 kubesphere/nodejs-6-centos7:v3.2.0 kubesphere/nodejs-4-centos7:v3.2.0 kubesphere/python-36-centos7:v3.2.0 kubesphere/python-35-centos7:v3.2.0 kubesphere/python-34-centos7:v3.2.0 kubesphere/python-27-centos7:v3.2.0 quay.io/argoproj/argocd:v2.3.3 quay.io/argoproj/argocd-applicationset:v0.4.1 ghcr.io/dexidp/dex:v2.30.2 redis:6.2.6-alpine jimmidyson/configmap-reload:v0.7.1 prom/prometheus:v2.39.1 kubesphere/prometheus-config-reloader:v0.55.1 kubesphere/prometheus-operator:v0.55.1 kubesphere/kube-rbac-proxy:v0.11.0 kubesphere/kube-state-metrics:v2.6.0 prom/node-exporter:v1.3.1 prom/alertmanager:v0.23.0 thanosio/thanos:v0.31.0 grafana/grafana:8.3.3 kubesphere/kube-rbac-proxy:v0.11.0 kubesphere/notification-manager-operator:v2.3.0 kubesphere/notification-manager:v2.3.0 kubesphere/notification-tenant-sidecar:v3.2.0 kubesphere/elasticsearch-curator:v5.7.6 kubesphere/opensearch-curator:v0.0.5 kubesphere/elasticsearch-oss:6.8.22 opensearchproject/opensearch:2.6.0 opensearchproject/opensearch-dashboards:2.6.0 kubesphere/fluentbit-operator:v0.14.0 docker:19.03 kubesphere/fluent-bit:v1.9.4 kubesphere/log-sidecar-injector:v1.2.0 elastic/filebeat:6.7.0 kubesphere/kube-events-operator:v0.6.0 kubesphere/kube-events-exporter:v0.6.0 kubesphere/kube-events-ruler:v0.6.0 kubesphere/kube-auditing-operator:v0.2.0 kubesphere/kube-auditing-webhook:v0.2.0 istio/pilot:1.14.6 istio/proxyv2:1.14.6 jaegertracing/jaeger-operator:1.29 jaegertracing/jaeger-agent:1.29 jaegertracing/jaeger-collector:1.29 jaegertracing/jaeger-query:1.29 jaegertracing/jaeger-es-index-cleaner:1.29 kubesphere/kiali-operator:v1.50.1 kubesphere/kiali:v1.50 busybox:1.31.1 nginx:1.14-alpine joosthofman/wget:1.0 nginxdemos/hello:plain-text wordpress:4.8-apache mirrorgooglecontainers/hpa-example:latest fluent/fluentd:v1.4.2-2.0 perl:latest kubesphere/examples-bookinfo-productpage-v1:1.16.2 kubesphere/examples-bookinfo-reviews-v1:1.16.2 kubesphere/examples-bookinfo-reviews-v2:1.16.2 kubesphere/examples-bookinfo-details-v1:1.16.2 kubesphere/examples-bookinfo-ratings-v1:1.16.3 weaveworks/scope:1.13.0

github-actions[bot] commented 3 months ago

Check the progress

镜像信息如下

典型使用场景Tips

配置镜像加速

20240606之后,应该加速的方式都逐步不可用了
获取阿里云镜像加速地址
根据提示配置镜像加速

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://xxxx.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

镜像信息部分的的两个文件保存到本地
然后愉快的使用以下脚本跑起来

联网环境拉取到本地并且tag为原始tag

适用于无法拉取外网地址或拉取外网地址缓慢

img=$(cat dockerhub-image.yml)
for i in ${img[@]}
do
    tagName=$(echo $i | awk -F "/" '{print $NF}');
    docker pull $i;
    sourceTag=$(cat images-init.yml | grep $tagName);
    docker tag $i $sourceTag;
done

联网环境拉取到本地打包

适用于内网环境需要将公网镜像打包到内网镜像仓库

img=$(cat dockerhub-image.yml)
for i in ${img[@]}
do
    tagName=$(echo $i | awk -F "/" '{print $NF}');
    filePrefix=$(echo $tagName | awk -F ":" '{print $1}');
    fileSuffix=$(echo $tagName | awk -F ":" '{print $NF}');
    fileName=$filePrefix--$fileSuffix.gz
    docker pull $i;
    mkdir localImage || echo 0
    docker save $i -o localImage/$fileName 
done
    # tar -zcf localImage.tar.gz localImage

将本地镜像包解压并且上传到私有仓库

# 将压缩好的镜像文件放在localImage目录
img=$(ls localImage)
# 本地仓库信息 LOCAL_REGISTRY 和 LOCAL_NAMESPACE 需要指定
# 如镜像local.harbor.dev/ingress-nginx/kube-webhook-certgen:v1.1.1
# LOCAL_REGISTRY则为:local.harbor.dev
# LOCAL_NAMESPACE则为:ingress-nginx
LOCAL_REGISTRY=
LOCAL_NAMESPACE=
# 首先解压镜像
for i in ${img[@]}
do
    docker load -i $i;
done

# 解压完成后,重新打tag并且上传指定仓库,需要确保需要有对应仓库的权限
img=$(cat dockerhub-image.yml)
for i in ${img[@]}
do
    tagName=$(echo $i | awk -F "/" '{print $NF}');
    specialTag=$LOCAL_REGISTRY/$LOCAL_NAMESPACE/$tagName;
    docker tag $i $specialTag;
    docker push $specialTag;
done