不幸的是,我无法在代理后面使用docker,我做了谷歌搜索建议,这就是我在运行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

10-07 19:15
查看更多