我试图让docker在公司代理后面工作。在此处关注文档: https://docs.docker.com/config/daemon/systemd/#httphttps-proxy
基本添加:
[Service]
Environment=“HTTP_PROXY=http://[username]:[password]@127.0.0.1:3128/”
在
下/etc/systemd/system/docker.service.d/http-proxy.conf
重新启动docker及其所有。
但是在运行“ docker pull hello-world”或“ sudo docker pull hello-world”时,出现此错误:
centos7 ~]$ docker pull hello-world
Using default tag: latest
Trying to pull repository docker. io/library/hello-world …
Pulling repository docker. io/library/hello-world
Error while pulling image: Get https:
/index.docker.io/v1/repositories/library/hello-world/images: AuthorizedOnly
环顾四周,但之前找不到任何报告的“仅授权”错误。
docker -v
Docker version 1.12.6, build 3e8e77d/1.12.6
任何提示/帮助表示赞赏。
答案 0 :(得分:1)
发现了问题:这不是Docker代理配置的问题。代理本身阻止了hub.docker.com。
为解决此特定问题,我使用了具有更少限制的其他代理。
谢谢!
答案 1 :(得分:0)
仔细检查您的企业代理URL。
HTTPS_PROXY
(设置为相同的HTTP URL)NO_PROXY
设置为localhost,以避免为每个远程查询联系代理。