Skip to content

Commit 6a40e17

Browse files
authored
Merge pull request #101 from EscapeLife/debug-k8s-host
fix: 🐛 k8s.gcr.io redirects to registry.k8s.io
2 parents 26b14ef + cb01c16 commit 6a40e17

File tree

1 file changed

+36
-9
lines changed

1 file changed

+36
-9
lines changed

README.md

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[**第三方 DockerHub 镜像服务列表**](https://github.com/cmliu/CF-Workers-docker.io?tab=readme-ov-file#%E7%AC%AC%E4%B8%89%E6%96%B9-dockerhub-%E9%95%9C%E5%83%8F%E6%9C%8D%E5%8A%A1)
22

3-
![img](./img.png)
3+
![CF-Workers-docker.io](./img.png)
4+
45
# 🐳 CF-Workers-docker.io:Docker仓库镜像代理工具
56

67
这个项目是一个基于 Cloudflare Workers 的 Docker 镜像代理工具。它能够中转对 Docker 官方镜像仓库的请求,解决一些访问限制和加速访问的问题。
@@ -23,15 +24,19 @@
2324
例如您的Workers项目域名为:`docker.cmliussss.net`
2425

2526
### 1.官方镜像路径前面加域名
27+
2628
```shell
2729
docker pull docker.cmliussss.net/stilleshan/frpc:latest
2830
```
31+
2932
```shell
3033
docker pull docker.cmliussss.net/library/nginx:stable-alpine3.19-perl
3134
```
3235

3336
### 2.一键设置镜像加速
37+
3438
修改文件 `/etc/docker/daemon.json`(如果不存在则创建)
39+
3540
```shell
3641
sudo mkdir -p /etc/docker
3742
sudo tee /etc/docker/daemon.json <<-'EOF'
@@ -42,14 +47,20 @@ EOF
4247
sudo systemctl daemon-reload
4348
sudo systemctl restart docker
4449
```
50+
4551
### 3. 配置常见仓库的镜像加速
46-
#### 3.1 配置
47-
Containerd 较简单,它支持任意 `registry``mirror`,只需要修改配置文件 `/etc/containerd/config.toml`,添加如下的配置:
52+
53+
#### 3.1 配置
54+
55+
`Containerd` 较简单,它支持任意 `registry``mirror`,只需要修改配置文件 `/etc/containerd/config.toml`,添加如下的配置:
56+
4857
```yaml
4958
[plugins."io.containerd.grpc.v1.cri".registry]
5059
[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
5160
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
5261
endpoint = ["https://xxxx.xx.com"]
62+
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."registry.k8s.io"]
63+
endpoint = ["https://xxxx.xx.com"]
5364
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."k8s.gcr.io"]
5465
endpoint = ["https://xxxx.xx.com"]
5566
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."gcr.io"]
@@ -59,7 +70,9 @@ Containerd 较简单,它支持任意 `registry` 的 `mirror`,只需要修改
5970
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."quay.io"]
6071
endpoint = ["https://xxxx.xx.com"]
6172
```
62-
`Podman` 同样支持任意 `registry``mirror`,修改配置文件 `/etc/containers/registries.conf`,添加配置:
73+
74+
`Podman` 同样支持任意 `registry``mirror`,修改配置文件 `/etc/containers/registries.conf`,添加配置:
75+
6376
```yaml
6477
unqualified-search-registries = ['docker.io', 'k8s.gcr.io', 'gcr.io', 'ghcr.io', 'quay.io']
6578

@@ -71,6 +84,14 @@ location = "registry-1.docker.io"
7184
[[registry.mirror]]
7285
location = "xxxx.xx.com"
7386

87+
[[registry]]
88+
prefix = "registry.k8s.io"
89+
insecure = true
90+
location = "registry.k8s.io"
91+
92+
[[registry.mirror]]
93+
location = "xxxx.xx.com"
94+
7495
[[registry]]
7596
prefix = "k8s.gcr.io"
7697
insecure = true
@@ -106,13 +127,18 @@ location = "xxxx.xx.com"
106127
```
107128

108129
#### 3.3 使用
109-
对于以上配置,k8s在使用的时候,就可以直接`pull`外部无法pull的镜像了
110-
手动可以直接`pull` 配置了`mirror`的仓库
111-
`crictl pull registry.k8s.io/kube-proxy:v1.28.4`
112-
`docker pull nginx:1.21`
130+
131+
对于以上配置,k8s 在使用的时候,就可以直接 `pull` 外部无法 pull 的镜像了。
132+
133+
```shell
134+
# 手动可以直接pull配置了mirror的仓库
135+
crictl pull registry.k8s.io/kube-proxy:v1.28.4
136+
docker pull nginx:1.21
137+
```
113138

114139
## 🔧 变量说明
115-
| 变量名 | 示例 | 必填 | 备注 |
140+
141+
| 变量名 | 示例 | 必填 | 备注 |
116142
|--|--|--|--|
117143
| URL302 | `https://t.me/CMLiussss` || 主页302跳转 |
118144
| URL | `https://www.baidu.com/` || 主页伪装(设为`nginx`则伪装为nginx默认页面) |
@@ -121,6 +147,7 @@ location = "xxxx.xx.com"
121147
# 🛠️ 第三方 DockerHub 镜像服务
122148

123149
**注意:**
150+
124151
- 以下内容仅做镜像服务的整理与搜集,未做任何安全性检测和验证。
125152
- 使用前请自行斟酌,并根据实际需求进行必要的安全审查。
126153
- 本列表中的任何服务都不做任何形式的安全承诺或保证。

0 commit comments

Comments
 (0)