ciiiii / cloudflare-docker-proxy

A docker registry proxy run on cloudflare worker.
964 stars 1.78k forks source link

docker pull 跟 login 始终返回 401 #11

Closed liuweiGL closed 1 month ago

liuweiGL commented 1 month ago

路由配置:

const routes = {
  "docker.xx.tech": "https://registry-1.docker.io",
  "quay.xx.tech": "https://quay.io",
  "gcr.xx.tech": "https://gcr.io",
  "k8s-gcr.xx.tech": "https://k8s.gcr.io",
  "k8s.xx.tech": "https://registry.k8s.io",
  "ghcr.xx.tech": "https://ghcr.io",
  "cloudsmith.xx.tech": "https://docker.cloudsmith.io",
};

使用 docker pull docker.xx.tech/hello-world 返回 401,docker login 也是返回 401 无法登录

ciiiii commented 1 month ago

duplicates of https://github.com/ciiiii/cloudflare-docker-proxy/issues/5, but I can support it if required

liuweiGL commented 1 month ago

麻烦作者大大抽空完善下吧,现在的环境下这个项目的作用很大

1574242600 commented 1 month ago

要匿名拉取官方镜像,需要加上 library,或者使用 registry-mirrors

docker pull docker.xx.tech/library/hello-world

如果不加,在 docker 请求令牌时, scope 的值为 repository:hello-world:pull。而拉取 hello-world 镜像需要的 scoperepository:library/hello-world:pull

ciiiii commented 1 month ago

fixed by #14 and #15 , please have a try @liuweiGL

ciiiii commented 1 month ago

@1574242600 Please help create an issue, I'm considering how to support this special case.