{"id":13496151,"url":"https://github.com/DaoCloud/public-image-mirror","last_synced_at":"2025-03-28T18:31:33.595Z","repository":{"id":37094860,"uuid":"404565294","full_name":"DaoCloud/public-image-mirror","owner":"DaoCloud","description":"很多镜像都在国外。比如 gcr 。国内下载很慢，需要加速。致力于提供连接全世界的稳定可靠安全的容器镜像服务。","archived":false,"fork":false,"pushed_at":"2025-03-20T03:51:26.000Z","size":988,"stargazers_count":9217,"open_issues_count":17,"forks_count":1115,"subscribers_count":58,"default_branch":"main","last_synced_at":"2025-03-25T11:53:23.354Z","etag":null,"topics":["mirror","speedup"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DaoCloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-09T02:53:40.000Z","updated_at":"2025-03-25T11:06:28.000Z","dependencies_parsed_at":"2023-11-13T05:25:43.220Z","dependency_job_id":"5a5c6532-a6ae-4433-b97f-8b453b0a8689","html_url":"https://github.com/DaoCloud/public-image-mirror","commit_stats":{"total_commits":913,"total_committers":141,"mean_commits":6.475177304964539,"dds":0.5125958378970428,"last_synced_commit":"6537ebc5e6c5ca2a339da34f76095c848c69c20f"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaoCloud%2Fpublic-image-mirror","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaoCloud%2Fpublic-image-mirror/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaoCloud%2Fpublic-image-mirror/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaoCloud%2Fpublic-image-mirror/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DaoCloud","download_url":"https://codeload.github.com/DaoCloud/public-image-mirror/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246080530,"owners_count":20720546,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mirror","speedup"],"created_at":"2024-07-31T19:01:43.043Z","updated_at":"2025-03-28T18:31:33.580Z","avatar_url":"https://github.com/DaoCloud.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# public-image-mirror\n\n源仓库 [Github](https://github.com/DaoCloud/public-image-mirror)  \nMirror 仓库 [Gitee](https://gitee.com/daocloud/public-image-mirror)  \n\n- 白名单 \u0026 限流 的公开信息 [#2328](https://github.com/DaoCloud/public-image-mirror/issues/2328)\n- 如有疑问请咨询 [#4183](https://github.com/DaoCloud/public-image-mirror/issues/4183)\n- 建议将拉取任务放在闲时 凌晨(北京时间 01-07 点), 其他时间段非常拥挤\n- 建议使用明确版本号的 tag, 对于 latest 这种变更后会需要重新同步\n\n## 背景 \u0026 目标\n\n很多镜像都在国外。比如 gcr 。国内下载很慢，需要加速。\n\n* 一个简洁有效的方法能够加速这些包。简洁的名称映射\n* 易于添加，添加新的包，不需要去修改代码。\n* 稳定可靠，更新实时。每天检查同步情况。\n* 此项目仅是源镜像仓库 (Registry) 的 Mirror\n  * 所有 hash(sha256) 均和源保持一致 (懒加载机制)。\n  * 由于缓存的存在, 可能存在 1 小时的延迟。\n  * 如超过 1 小时还未更新, 估计是国际带宽挂了。\n* 对于 镜像层(blob) 会缓存在第三方对象存储上\n  * 当前暂未对内容做任何检测, 计划会添加检测。\n\n## 快速开始\n\n```\ndocker run -d -P m.daocloud.io/docker.io/library/nginx\n```\n## 使用方法\n\n**增加前缀** (推荐方式)。比如：\n\n``` log\n              docker.io/library/busybox\n                 |\n                 V\nm.daocloud.io/docker.io/library/busybox\n```\n\n或者 支持的镜像仓库 的 *前缀替换* 就可以使用。比如：\n\n``` log\n           docker.io/library/busybox\n             |\n             V\ndocker.m.daocloud.io/library/busybox\n```\n\n## 无缓存\n\n在拉取的时候如果我们没有缓存, 将会在 [同步队列](https://queue.m.daocloud.io/status/) 添加同步缓存的任务.\n\n## 支持前缀替换的 Registry (不推荐)\n\n推荐使用添加前缀的方式.\n\n前缀替换的 Registry 的规则, 这是人工配置的, 有需求提 Issue.\n\n| 源站               | 替换为                | 备注                                           |\n| ------------------ | --------------------- | ---------------------------------------------- |\n| docker.elastic.co  | elastic.m.daocloud.io |                                                |\n| docker.io          | docker.m.daocloud.io  |                                                |\n| gcr.io             | gcr.m.daocloud.io     |                                                |\n| ghcr.io            | ghcr.m.daocloud.io    |                                                |\n| k8s.gcr.io         | k8s-gcr.m.daocloud.io | k8s.gcr.io 已被迁移到 registry.k8s.io          |\n| registry.k8s.io    | k8s.m.daocloud.io     |                                                |\n| mcr.microsoft.com  | mcr.m.daocloud.io     |                                                |\n| nvcr.io            | nvcr.m.daocloud.io    |                                                |\n| quay.io            | quay.m.daocloud.io    |                                                |\n| registry.ollama.ai | ollama.m.daocloud.io  | 实验内测中，[使用方法](#加速-ollama--deepseek) |\n\n## 最佳实践\n\n### 加速 Kubneretes\n\n#### 加速安装 kubeadm\n``` bash\nkubeadm config images pull --image-repository k8s-gcr.m.daocloud.io\n```\n\n#### 加速安装 kind\n\n``` bash\nkind create cluster --name kind --image m.daocloud.io/docker.io/kindest/node:v1.22.1\n``` \n\n#### 加速 Containerd\n\n* 参考 Containerd 官方文档: [hosts.md](https://github.com/containerd/containerd/blob/main/docs/hosts.md#registry-host-namespace)\n* 如果您使用 kubespray 安装 containerd, 可以配置 [`containerd_registries_mirrors`](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/CRI/containerd.md#containerd-config)\n\n### 加速 Docker\n\n添加到 `/etc/docker/daemon.json`\n``` json\n{\n  \"registry-mirrors\": [\n    \"https://docker.m.daocloud.io\"\n  ]\n}\n```\n\n### 加速 Ollama \u0026 DeepSeek\n\n#### 加速安装 Ollama\n\nCPU:\n```bash\ndocker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama docker.m.daocloud.io/ollama/ollama\n```\n\nGPU 版本:\n1. 首先安装 Nvidia Container Toolkit\n2. 运行以下命令启动 Ollama 容器：\n\n```bash\ndocker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 --name ollama docker.m.daocloud.io/ollama/ollama\n```\n\n更多信息请参考：\n* [Ollama Docker 官方文档](https://ollama.com/blog/ollama-is-now-available-as-an-official-docker-image)\n\n#### 加速使用 Deepseek-R1 模型（实验内测中）\n\n如上述步骤，在启动了ollama容器的前提下，还可以通过加速源，加速启动DeepSeek相关的模型服务\n\n注：目前 Ollama 官方源的下载速度已经很快，您也可以直接使用[官方源](https://ollama.com/library/deepseek-r1:1.5b)。\n\n```bash\n# 使用加速源\ndocker exec -it ollama ollama run ollama.m.daocloud.io/library/deepseek-r1:1.5b\n\n# 或直接使用官方源下载模型\n# docker exec -it ollama ollama run deepseek-r1:1.5b\n```\n\n## [友情链接]加速三剑客\n\n* 镜像加速：https://github.com/DaoCloud/public-image-mirror\n* 二进制文件加速：https://github.com/DaoCloud/public-binary-files-mirror\n* Helm 加速：https://github.com/DaoCloud/public-helm-charts-mirror\n\n\n## 贡献者\n\n\u003ca href=\"https://github.com/DaoCloud/public-image-mirror/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=DaoCloud/public-image-mirror\" /\u003e\n\u003c/a\u003e\n\nMade with [contrib.rocks](https://contrib.rocks).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDaoCloud%2Fpublic-image-mirror","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDaoCloud%2Fpublic-image-mirror","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDaoCloud%2Fpublic-image-mirror/lists"}