很多镜像都在国外。比如 gcr 。国内下载很慢,需要加速。
Go to file
Jared Tan ee113556f3
Update mirror.txt
2022-02-15 15:53:07 +08:00
.github/workflows Add manual-deep-sync 2022-02-10 12:43:43 +08:00
hack Fix exit trap 2022-02-10 10:02:16 +08:00
README.md Update badge with the gh-pages branch (#65) 2022-01-19 22:32:53 +08:00
domain.txt Add mirror and domain 2021-12-24 13:44:37 +08:00
exclude.txt Update exclude.txt 2022-01-28 22:13:40 +08:00
mirror.txt Update mirror.txt 2022-02-15 15:53:07 +08:00

README.md

public-image-mirror

Sync Deep Sync

背景

很多镜像都在国外。比如 gcr 。国内下载很慢,需要加速。

目标

  • 一个简洁有效的方法能够加速这些包。简洁的名称映射
  • 易于添加,添加新的包,不需要去修改代码。
  • 稳定可靠,更新实时。每天检查同步情况。

快速开始

docker run -d -P docker.m.daocloud.io/nginx

使用方法

支持的镜像仓库 的 前缀替换 就可以使用。比如:

k8s.gcr.io/coredns/coredns => k8s-gcr.m.daocloud.io/coredns/coredns

支持的镜像源

domain.txt

如果想要新增, 提 PR 修改即可。例如 PR#28

支持的镜像

mirror.txt

如果想要新增, 提 PR 修改即可。例如 PR#1

替换规则

源站 替换为
cr.l5d.io l5d.m.daocloud.io
docker.elastic.co elastic.m.daocloud.io
docker.io docker.m.daocloud.io
gcr.io gcr.m.daocloud.io
ghcr.io ghcr.m.daocloud.io
k8s.gcr.io k8s-gcr.m.daocloud.io
mcr.microsoft.com mcr.m.daocloud.io
nvcr.io nvcr.m.daocloud.io
quay.io quay.m.daocloud.io
registry.jujucharms.com jujucharms.m.daocloud.io
rocks.canonical.com rocks-canonical.m.daocloud.io

最佳实践

  • 通过 加速 安装 kubeadm
kubeadm config images pull --image-repository k8s-gcr.m.daocloud.io
  • 通过 加速 安装 kind
kind create cluster --name kind --image docker.m.daocloud.io/kindest/node:v1.22.1
  • 通过 加速 部署 应用(这里以 Ingress 为例)
wget -O image-filter.sh https://github.com/DaoCloud/public-image-mirror/raw/main/hack/image-filter.sh && chmod +x image-filter.sh

wget -O deploy.yaml https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.1.0/deploy/static/provider/baremetal/deploy.yaml

cat ./deploy.yaml | ./image-filter.sh | kubectl apply -f -