1号坑:
$ 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/": proxyconnect tcp: dial tcp 127.0.0.1:7890: connect: connection refused.
See 'docker run --help'.
# 查看docker代理配置如下,只需要把7890改成代理工具中的端口号即可
$ cat /etc/systemd/system/docker.service.d/proxy.conf
[Service]
Environment="HTTP_PROXY=localhost:7890"
Environment="HTTPS_PROXY=localhost:7890"
2号坑:docker官方的guide
# visit http://localhost:8080 in your browser.
docker run -d -p 8080:80 docker/welcome-to-docker
这里需要设置代理和镜像源,否则镜像拉取不到,然后卡在这👇
Unable to find image 'docker/welcome-to-docker:latest' locally
latest: Pulling from docker/welcome-to-docker
96526aa774ef: Retrying in 9 seconds
740091335c74: Retrying in 9 seconds
da9c2e764c5b: Retrying in 9 seconds
ade17ad21ef4: Waiting
4e6f462c8a69: Waiting
1324d9977cd2: Waiting
1b9b96da2c74: Waiting
5d329b1e101a: Waiting
设置代理和镜像源的方法参考链接
:实测有效
3号坑:官方的docker desktop安装
现象:
1:安装后,能成功打开docker desktop,但是死活登录不上
2:在前面1号坑解决了的问题,一旦打开了docker desktop,问题又会重新出现
问题定位:其实还是代理的问题
docker desktop设置代理的方法参考链接
:实测有效