dockerpipe理员如何获得200而不是401的返回码
在工作docker是无法拉图像:
[b209d3c5] +job pull(ubuntu, ) [debug] registry.go:372 [registry] Calling GET https://index.docker.io/v1/repositories/ubuntu/images [debug] http.go:160 https://index.docker.io/v1/repositories/ubuntu/images -- HEADERS: map[User-Agent:[docker/1.0.0 go/go1.2.2 git-commit/63fe64c kernel/3.15.1-1-ARCH os/linux arch/amd64]] [debug] server.go:1182 Retrieving the tag list [debug] http.go:160 https://cdn-registry-1.docker.io/v1/repositories/library/ubuntu/tags -- HEADERS: map[User-Agent:[docker/1.0.0 go/go1.2.2 git-commit/63fe64c kernel/3.15.1-1-ARCH os/linux arch/amd64]] [debug] registry.go:327 Got status code 401 from https://cdn-registry-1.docker.io/v1/repositories/library/ubuntu/tags [error] server.go:1185 Could not reach any registry endpoint Could not reach any registry endpoint [b209d3c5] -job pull(ubuntu, ) = ERR (1)
如果我手动尝试访问第二个URL,它也可以导致401。
然而,在家里,同样的命令pipe理成功检索标签:
[4e9acee4] +job pull(ubuntu, ) [debug] registry.go:372 [registry] Calling GET https://index.docker.io/v1/repositories/ubuntu/images [debug] http.go:160 https://index.docker.io/v1/repositories/ubuntu/images -- HEADERS: map[User-Agent:[docker/1.0.0 go/go1.2.2 git-commit/63fe64c kernel/3.14.6-1-ARCH os/linux arch/amd64]] [debug] server.go:1182 Retrieving the tag list [debug] http.go:160 https://cdn-registry-1.docker.io/v1/repositories/library/ubuntu/tags -- HEADERS: map[User-Agent:[docker/1.0.0 go/go1.2.2 git-commit/63fe64c kernel/3.14.6-1-ARCH os/linux arch/amd64]] [debug] registry.go:327 Got status code 200 from https://cdn-registry-1.docker.io/v1/repositories/library/ubuntu/tags [debug] server.go:1197 Registering tags [...]
问题是:这个docker实例怎么得到200结果?
有没有一个好方法来检查沟通? (由于https完全encryption,Wireshark可能不太好。)
可能唯一的办法就是阅读源代码 。 但是我对走的语言不太了解。
你能想到任何更好的解决scheme,build立自己的docker,并添加一些debugging打印?
看起来像REST调用需要一个有效的Authorization: Token ...
标题。 也似乎公司代理打破了头。 🙁
从源build造docker是非常痛苦的。