Docker不能在代理之后工作

不幸的是,我不能使用我的docker在代理后面,我做了谷歌search提示,这是我运行sudo docker run hello-world时得到的错误:

 Unable to find image 'hello-world:latest' locally docker: Error response from daemon: Get https://registry- 1.docker.io/v2/: Proxy Authentication Required. See 'docker run --help'. 

这是我的'/etc/systemd/system/docker.service.d/http-proxy.conf'文件:

 [Service] Environment="HTTP_PROXY=http://user:pass@127.0.0.1:8800/" Environment="HTTPS_PROXY=https://user:pass@127.0.0.1:8800/" 

我的“etc / default / docker”文件:

 export http_proxy="http://127.0.0.1:3128/" export https_proxy="http://127.0.0.1:3128/" export HTTP_PROXY="http://127.0.0.1:3128/" export HTTPS_PROXY="http://127.0.0.1:3128/" 

问题是什么? 谢谢 :)

尝试这个,

 $ sudo vim /etc/resolv.conf #add these lines on top and above one for home router… nameserver 8.8.8.8 nameserver 8.8.4.4 

保存/etc/resolv.conf文件后。

运行$ sudo systemctl daemon-reload加载守护进程。

然后重新启动您的docker:

运行$ sudo systemctl restart docker