containerd 镜像拉取 ns 参数支持 #72

Closed
opened 2025-09-09 17:13:40 +08:00 by BaiMeow · 7 comments
BaiMeow commented 2025-09-09 17:13:40 +08:00 (Migrated from github.com)

containerd 在拉取镜像的时候实现了一个新的参数 ns ,当使用 mirror 拉取时会自动附加上这个参数来表示该镜像的原命名空间

例如,给 docker.io 配置 mirror 的时候,containerd 会在请求中添加 ?ns=docker.io

能否利用这个参数至少在 containerd 里实现无需修改镜像名的镜像拉取

https://github.com/containerd/containerd/blob/main/docs/hosts.md#registry-host-namespace

containerd 在拉取镜像的时候实现了一个新的参数 ns ,当使用 mirror 拉取时会自动附加上这个参数来表示该镜像的原命名空间 例如,给 docker.io 配置 mirror 的时候,containerd 会在请求中添加 `?ns=docker.io` 能否利用这个参数至少在 containerd 里实现无需修改镜像名的镜像拉取 https://github.com/containerd/containerd/blob/main/docs/hosts.md#registry-host-namespace
sky22333 commented 2025-09-09 17:49:29 +08:00 (Migrated from github.com)

支持了,加了个判断,不知是否可行,在ns分支你自己编译测试一下

https://github.com/sky22333/hubproxy/tree/ns

支持了,加了个判断,不知是否可行,在`ns`分支你自己编译测试一下 https://github.com/sky22333/hubproxy/tree/ns
BaiMeow commented 2025-09-10 20:40:06 +08:00 (Migrated from github.com)

很好用

很好用
sky22333 commented 2025-09-10 22:04:36 +08:00 (Migrated from github.com)

支持了吗?有啥问题吗?

支持了吗?有啥问题吗?
BaiMeow commented 2025-09-11 01:19:55 +08:00 (Migrated from github.com)

我的k3s上已经在用了,目前没有出现任何问题,完全可以直接合并到主分支上去了

我的k3s上已经在用了,目前没有出现任何问题,完全可以直接合并到主分支上去了
sky22333 commented 2025-09-11 02:04:40 +08:00 (Migrated from github.com)

ok,感谢测试

ok,感谢测试
BaiMeow commented 2025-09-13 14:34:37 +08:00 (Migrated from github.com)

用了一会,反馈一下,似乎目前?ns=docker.io时会400,建议ns=docker.io时视为不存在ns这个参数

用了一会,反馈一下,似乎目前?ns=docker.io时会400,建议ns=docker.io时视为不存在ns这个参数
sky22333 commented 2026-01-11 00:53:57 +08:00 (Migrated from github.com)

试试最新版本,应该不会出现此问题了

试试最新版本,应该不会出现此问题了
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: 3344/hubproxy#72