与Docker的连接问题 [英] Connection issue with Docker

查看:131
本文介绍了与Docker的连接问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我更新了我们的一个服务器,并且我在服务器上安装了Docker。一切都成功了,在一定程度上。我正在通过创建Docker映像的一个示例来处理我的错误,我收到以下错误:


sudo docker运行hello-world
无法在本地找到图像'hello-world:latest'
拉取存储库hello-world
FATA获取https://index.docker.io/v1/repositories/library/hello-world/images :拨打tcp 162.242.195.84:443:连接超时


我正在使用我们的网络管理员进行检查,因为我可以通过浏览器浏览有关的URL,并获得以下内容JSON:

  [{checksum:,id:e45a5af57b00862e5ef5782a9925979a02ba2b12dff832fd0991335f4a11e5c5},{checksum ,id:31cbccb51277105ba3ae35ce33c22b69c9e3f1002e76e4c736a2e8ebff9d7b5d},{checksum:,id:ef872312fe1bbc5e05aae626791a47ee9b032efa8f3bda39cc0be7b56bfe59b9},{checksum:,id:7fa0dcdc 88de9c8a856f648c1f8e0cf8141a505bbddb7ecc0c61f1ed5e086852 },{ 校验和 : , ID: bf16b6e27882c0790071c95326e0186eccd2b8ac2bd5ef34fecdbb332a90926e},{ 校验和 : , ID: 8f5550346e6173730dca712d1fc87e671ae04d5899d6c4290f7897c054b2318e},{ 校验和: , ID: f86750113cd23609d504342d39015d5c7f218935b8420dd43b79cd99f4f93960},{ 校验和: , ID: 0a1b1cfaa9a2153fdabe163d562fe1321a5c1d1db3a59e0fac7c65f966bc38a9},{ 校验和: , ID: 511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158},{ 校验和: , ID :2505d942a91db2045278f9d5c58067414d367c02506bbba96f0769a6ac6ad47b},{checksum:,id:565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1}] 

搜索网页显示一些其他人有这些错误,但决议在这里没有工作。这可能是代理还是端口问题?



我正在使用最新版本的Docker

  docker version 
客户端版本:1.6.1
客户端API版本:1.18
Go版本(客户端):go1.4.2
Git提交(客户端):97cd073
操作系统/客户端):linux / amd64
FATA [0000]获取http:///var/run/docker.sock/v1.18/version:dial unix /var/run/docker.sock:permission denied。您是否尝试连接到不带TLS的启用TLS的守护程序?

当我运行 docker pull hello-world 我得到以下答复:


FATA [0000]发布http:///var/run/docker.sock/v1.18/images/create?fromImage=hello-world%3Alatest :拨打unix /var/run/docker.sock:权限被拒绝。您是否尝试连接到不带TLS的启用TLS的守护程序?


当我运行 sudo docker pull hello -world 即使我可以成功地卷曲URL,我也收到超时消息 -


FATA [0162] Get https://index.docker.io/v1/repositories/library/hello-world/images :拨打tcp 162.242.195.84:443:连接超时


尝试 curl -v https: //index.docker.io:443 返回

  *重建URL到:https:// index.docker.io:443/ 
* DNS缓存中未找到主机名
*尝试172.31.1.70 ...
*连接到172.31.1.70(172.31.1.70)端口80( #0)
*建立HTTP代理隧道到index.docker.io:443
*使用Basic与用户'chance1'代理身份验证
> CONNECT index.docker.io:443 HTTP / 1.1
>主机:index.docker.io:443
>代理授权:基本Y2hhbmNlMToyMDBEdWxsZXM =
>用户代理:curl / 7.35.0
>代理连接:Keep-Alive
>
< HTTP / 1.1 200连接建立
<
*代理回复确认CONNECT请求
*成功设置证书验证位置:
* CAfile:none
CApath:/ etc / ssl / certs
* SSLv3,TLS握手,客户端你好(1):
* SSLv3,TLS握手,服务器hello(2):
* SSLv3,TLS握手,CERT(11):
* SSLv3,TLS握手,服务器密钥交换(12):
* SSLv3,TLS握手,服务器完成(14):
* SSLv3,TLS握手,客户端密钥交换(16):
* SSLv3,TLS更改密码,客户端hello(1):
* SSLv3,TLS握手,完成(20):
* SSLv3,TLS更改密码,客户端hello(1):
* SSLv3,TLS握手,完成20):
*使用ECDHE-RSA-AES128-GCM-SHA256的SSL连接
*服务器证书:
*主题:OU = GT98568428; OU =见www.rapidssl.com/resources/cps(c)15; OU =域控制已验证 - RapidSSL(R); CN = *。docker.io
*开始日期:2015-03-19 17:34:32 GMT
*到期日:2018-04-21 01:51:52 GMT
* subjectAltName:index.docker.io匹配
* issuer:C = US; O = GeoTrust Inc. CN = RapidSSL SHA256 CA - G3
* SSL证书验证确定。
> GET / HTTP / 1.1
>用户代理:curl / 7.35.0
>主机:index.docker.io
>接受:* / *
>
< HTTP / 1.1 301 MOVED PERMANENTLY
*服务器nginx / 1.6.2未列入黑名单
<服务器:nginx / 1.6.2
<日期:Wed,13 May 2015 20:43:03 GMT
< Content-Type:text / html; charset = utf-8
<转移编码:chunked
<连接:关闭
< X框架选项:SAMEORIGIN
<位置:https://registry.hub.docker.com/
<严格运输安全:max-age = 31536000
<
*关闭连接0
* SSLv3,TLS警报,客户端hello(1):


解决方案

从您的curl命令可以看出,您正在使用代理。所以,您需要执行以下操作(在Ubuntu中)使其正常工作:_
1.编辑您的 / etc / default / docker 文件根据您的 /etc/apt/apt.conf ,取消注释和编辑行说 export http_proxy =...文件。

2. sudo service docker restart

3.最后测试 sudo docker login


I updated one of our servers and I have installed Docker on the server. Everything has been successful, to a degree. I was working my way through one of the examples of creating a Docker image and I got the following error:

sudo docker run hello-world Unable to find image 'hello-world:latest' locally Pulling repository hello-world FATA[0162] Get https://index.docker.io/v1/repositories/library/hello-world/images: dial tcp 162.242.195.84:443: connection timed out

I am checking into this with our network admins as I am able to surf, via browser, to the URL in question and get the following JSON:

[{"checksum": "", "id": "e45a5af57b00862e5ef5782a9925979a02ba2b12dff832fd0991335f4a11e5c5"}, {"checksum": "", "id": "31cbccb51277105ba3ae35ce33c22b69c9e3f1002e76e4c736a2e8ebff9d7b5d"}, {"checksum": "", "id": "ef872312fe1bbc5e05aae626791a47ee9b032efa8f3bda39cc0be7b56bfe59b9"}, {"checksum": "", "id": "7fa0dcdc88de9c8a856f648c1f8e0cf8141a505bbddb7ecc0c61f1ed5e086852"}, {"checksum": "", "id": "bf16b6e27882c0790071c95326e0186eccd2b8ac2bd5ef34fecdbb332a90926e"}, {"checksum": "", "id": "8f5550346e6173730dca712d1fc87e671ae04d5899d6c4290f7897c054b2318e"}, {"checksum": "", "id": "f86750113cd23609d504342d39015d5c7f218935b8420dd43b79cd99f4f93960"}, {"checksum": "", "id": "0a1b1cfaa9a2153fdabe163d562fe1321a5c1d1db3a59e0fac7c65f966bc38a9"}, {"checksum": "", "id": "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158"}, {"checksum": "", "id": "2505d942a91db2045278f9d5c58067414d367c02506bbba96f0769a6ac6ad47b"}, {"checksum": "", "id": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1"}]

Searching the web showed some others with these errors, but the resolutions did not work here. Could this be a proxy or port issue?

I am using the latest version of Docker

docker version
Client version: 1.6.1
Client API version: 1.18
Go version (client): go1.4.2
Git commit (client): 97cd073
OS/Arch (client): linux/amd64
FATA[0000] Get http:///var/run/docker.sock/v1.18/version: dial unix /var/run/docker.sock: permission denied. Are you trying to connect to a TLS-enabled daemon without TLS?

When I run docker pull hello-world I get the following response:

FATA[0000] Post http:///var/run/docker.sock/v1.18/images/create?fromImage=hello-world%3Alatest: dial unix /var/run/docker.sock: permission denied. Are you trying to connect to a TLS-enabled daemon without TLS?

When I run sudo docker pull hello-world I get a timeout message even though I can curl the URL successfully -

FATA[0162] Get https://index.docker.io/v1/repositories/library/hello-world/images: dial tcp 162.242.195.84:443: connection timed out

Trying curl -v https://index.docker.io:443 returns

* Rebuilt URL to: https://index.docker.io:443/
* Hostname was NOT found in DNS cache
*   Trying 172.31.1.70...
* Connected to 172.31.1.70 (172.31.1.70) port 80 (#0)
* Establish HTTP proxy tunnel to index.docker.io:443
* Proxy auth using Basic with user 'chance1'
> CONNECT index.docker.io:443 HTTP/1.1
> Host: index.docker.io:443
> Proxy-Authorization: Basic Y2hhbmNlMToyMDBEdWxsZXM=
> User-Agent: curl/7.35.0
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 Connection established
<
* Proxy replied OK to CONNECT request
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server key exchange (12):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using ECDHE-RSA-AES128-GCM-SHA256
* Server certificate:
*        subject: OU=GT98568428; OU=See www.rapidssl.com/resources/cps (c)15; OU=Domain Control Validated - RapidSSL(R); CN=*.docker.io
*        start date: 2015-03-19 17:34:32 GMT
*        expire date: 2018-04-21 01:51:52 GMT
*        subjectAltName: index.docker.io matched
*        issuer: C=US; O=GeoTrust Inc.; CN=RapidSSL SHA256 CA - G3
*        SSL certificate verify ok.
> GET / HTTP/1.1
> User-Agent: curl/7.35.0
> Host: index.docker.io
> Accept: */*
>
< HTTP/1.1 301 MOVED PERMANENTLY
* Server nginx/1.6.2 is not blacklisted
< Server: nginx/1.6.2
< Date: Wed, 13 May 2015 20:43:03 GMT
< Content-Type: text/html; charset=utf-8
< Transfer-Encoding: chunked
< Connection: close
< X-Frame-Options: SAMEORIGIN
< Location: https://registry.hub.docker.com/
< Strict-Transport-Security: max-age=31536000
<
* Closing connection 0
* SSLv3, TLS alert, Client hello (1):

解决方案

From your curl command, it is clear that you are using proxy. So, you need to do the following (in Ubuntu) to make it work:
1. Edit your /etc/default/docker file (Uncomment and edit line saying export http_proxy="..." based on your /etc/apt/apt.conf file.
2. sudo service docker restart
3. Finally test sudo docker login

这篇关于与Docker的连接问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆