Docker 镜像源
HubProxy 通过 [registries] 段配置第三方 Registry 的上游地址与认证端点。Docker Hub 固定代理到 registry-1.docker.io,无需在此段配置。
默认 Registry 映射
Section titled “默认 Registry 映射”config.toml 中预置了常用 Registry:
[registries."ghcr.io"]upstream = "ghcr.io"authHost = "ghcr.io/token"authType = "github"enabled = true
[registries."gcr.io"]upstream = "gcr.io"authHost = "gcr.io/v2/token"authType = "google"enabled = true
[registries."quay.io"]upstream = "quay.io"authHost = "quay.io/v2/auth"authType = "quay"enabled = true
[registries."registry.k8s.io"]upstream = "registry.k8s.io"authHost = "registry.k8s.io"authType = "anonymous"enabled = trueauthType 说明
Section titled “authType 说明”| authType | 含义 |
|---|---|
anonymous |
匿名 Registry(如 registry.k8s.io) |
github |
GHCR 认证端点 |
google |
GCR 认证端点 |
quay |
Quay.io 认证端点 |
拉取路径格式
Section titled “拉取路径格式”# Docker Hub(无需前缀 registry 域名,官方镜像自动补齐 library 与 latest)docker pull example.com/nginx
# 第三方 Registrydocker pull example.com/ghcr.io/owner/image:tag也支持 containerd 的 ns 查询参数识别已配置的 Registry。
启用/禁用 Registry
Section titled “启用/禁用 Registry”[registries."quay.io"]enabled = falseToken 与 Manifest 缓存
Section titled “Token 与 Manifest 缓存”[tokenCache] 段控制上游认证 Token 与 Manifest 缓存:
[tokenCache]enabled = truedefaultTTL = "20m"digest 引用缓存 24 小时,latest 等常用 tag 缓存 10 分钟,详见 config.toml 参考。