在工作中,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。
然而,在家里,同样的命令以某种方式成功地检索到了标签:
[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并添加一些调试打印?
发布于 2014-06-21 19:51:53
看起来REST调用requires是一个有效的Authorization: Token ...头。公司代理似乎也打破了这个头。:(
从源代码构建docker真的很轻松。
https://stackoverflow.com/questions/24340783
复制相似问题