在工作中,码头工具无法提取图像:
[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。
然而,在家里,同样的命令以某种方式设法成功检索标签:
[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结果?
有没有好的方法来检查通讯? (Wireshark可能不太好,因为https已完全加密。)
可能唯一的方法是阅读source code。但我对go语言知之甚少。
你能想到更好的解决方案吗,自己构建docker并添加一些调试打印?
答案 0 :(得分:1)
似乎REST调用requires一个有效的Authorization: Token ...
标头。似乎公司代理打破了这个标题。 :(
从源头建造码头工具真的很无痛。