问题描述
在做爬虫项目时,需要用到代理池,想法是把获取代理的Python项目打包成Docker镜像,然后执行以下命令
docker login
报错信息如下
Authenticating with existing credentials...
Login did not succeed, error: Error response from daemon: Get https://registry-1.docker.io/v2/: Get https://auth.docker.io/token?account=qinexpire&client_id=docker&offline_token=true&service=registry.docker.io: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username (qinexpire): qinexpire
Password:
Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
解决思路
从报错信息来看,应该是代理的问题(如果不翻墙,命令行无法登陆,不清楚是不是所有人都是这个情况),然后去Docker App看了下,Proxies选项默认使用System proxy
如下图:
既然系统默认代理不可用,就尝试手动配置下代理,我的PC默认代理端口是1087,代理配置信息如下图
此时命令行执行docker login
后提示Login Succeeded
,问题解决!