Dockerlogin错误与入门教程

我试图在Docker的网站上关注初学者教程 ,并且在login时遇到了一个错误。
操作系统是Ubuntu 14.04 ,我没有使用VirtualBox,我不支持任何代理,并希望推到“常规”docker库(不是私人的)。

所有线程我发现提及代理和私人存储库,但是这不是我的情况,我只是想做简单的初学者教程。
这是我的尝试:

  $ sudo docker login [sudo] password for myuname: 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: myDHuname 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信息:

 Containers: 5 Running: 0 Paused: 0 Stopped: 5 Images: 5 Server Version: 1.11.0 Storage Driver: aufs Root Dir: /var/lib/docker/aufs Backing Filesystem: extfs Dirs: 28 Dirperm1 Supported: true Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge null host Kernel Version: 3.19.0-58-generic Operating System: Ubuntu 14.04.4 LTS OSType: linux Architecture: x86_64 CPUs: 4 Total Memory: 7.686 GiB Name: myuname-ThinkPad-T420 ID: 6RW3:X3FC:T62N:CWKI:JQW5:YIPY:RAHO:ZHF4:DFZ6:ZL7X:JPOD:V7EC Docker Root Dir: /var/lib/docker Debug mode (client): false Debug mode (server): false Registry: https://index.docker.io/v1/ WARNING: No swap limit support 

结语

现在docker login正在通过。 从昨天开始,我没有碰到任何东西。
我不能再现这种行为。

我第一次使用docker时遇到这个问题。 我已经shadowsocks代理,并被认定为pac模式。 当我尝试run docker run hello-world ,我得到这个超时错误。 当我将代理模式设置为全局时,错误也是如此。

但是,当我禁用代理,docker运行良好。 它成功地拉远程图像。

docker的窗户

注意:有些用户报告Docker for Windows稳定版连接到Docker Hub的问题。 当试图运行docker命令从Docker Hub中拖出那些还没有下载的图像,比如第一次运行docker run hello-world时,这会显示为错误。 如果遇到此问题,请重置DNS服务器以使用Google DNS固定地址:8.8.8.8。 有关详细信息,请参阅疑难解答中的networking问题

Client.Timeout exceeded while awaiting headers错误Client.Timeout exceeded while awaiting headers表示:

GET请求到registryhttps://registry-1.docker.io/v2/超时

  • 负责人(很有可能是libcurl)在听到答复之前超时了
  • 连接从未形成(代理/防火墙吞噬了它)

如果你看到下面的结果,你可以排除超时和networking连接

 $ curl https://registry-1.docker.io/v2/ {"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":null}]} 

如果你得到上面的回应,接下来要检查你的用户环境是否有一些代理configuration。

 env | grep "proxy" 

注意:docker作为root运行。 也许你在你的环境中有http_proxy。 我很可能是错的。 任何谁看到curl GET请求发生了什么

更改Firefox中的代理设置。 可能是你在访问限制模式。 只需在Firefox设置 – >首选项 – >高级 – >networking – >configuration(设置)中添加服务器地址。 在无代理服务器上添加服务器ip可以解决问题