Docker 在防火墙后的 CentOS 6.7 连接问题
CentOS 6.7 Connection Issues with Docker behind a firewall
请忽略我在链接和 URL 中的错误空格。我没有 post > 2 个网址或 2 个链接所需的声誉。
我新安装了 CentOS 6.7,如下面的 uname -a 命令所示:
Linux 2.6.32-573.7.1.el6.x86_64 #1 SMP 9 月 22 日星期二 22:00:00 UTC 2015 x86_64 x86_64 x86_64GNU/Linux
这台机器在公司防火墙后面。
我已经安装了 docker-io。版本信息为(docker版本):
客户端版本:1.7.1
客户端 API 版本:1.19
Go版本(客户端):go1.4.2
Git 提交(客户端):786b29d/1.7.1
OS/Arch(客户):linux/amd64
服务器版本:1.7.1
服务器 API 版本:1.19
Go版本(服务器):go1.4.2
Git 提交(服务器):786b29d/1.7.1
OS/Arch(服务器):linux/amd64
docker 服务是 运行ning:
docker (pid 2593) 是 运行ning...
当我运行
sudo docker 拉你好世界
我收到错误:
获取 https : //index.docker.io/v1/repositories/library/hello-world/images: dial tcp 54.165.23.153:443: connection timed out
当我运行
sudo docker 运行 你好世界
我得到一个类似的错误:
获取 https : //index.docker.io/v1/repositories/library/hello-world/images: dial tcp 52.7.162.45:443: connection timed out
我可以浏览到 URL
https : //index.docker.io/v1/repositories/library/hello-world/images 在 Firefox 中(在我为代理输入 userid/password 之后)。我得到:
[{"checksum": "", "id": "3f12c794407e68e515ba7f473a744e748ac8a827a2ea8b33855dec564238b2e5"}, {"checksum": "", "id": "975b84d108f1024953937167506c2935a081c8c55ae9e9f7b7deee118605367f"}, {"checksum": "", "id": "535020c3e8add9d6bb06e5ac15a261e73d9b213d62fb2c14d752b8e189b2b912"}, {"checksum": "", "id": "af340544ed62de0680f441c71fa1a80cb084678fed42bae393e543faea3a572c"}, {"checksum": " ", "id": "a8219747be10611d65b7c693f48e7222c0bf54b5df8467d3f99003611afa1fd8"}, {"checksum": "", "id": "91c95931e552b11604fea91c2f537284149ec32fff0f700a4769cfd31d7696ae"}, {"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"}]
curl www.google.com 和 curl http://www.google.com 工作正常。
当我运行:
curl -v https://index.docker.io:443
我得到以下信息:
*即将连接()到index.docker.io端口443(#0)
* 尝试 54.165.23.153...连接超时
* 尝试 54.84.122.145...连接超时
* 尝试 52.7.162.45...连接超时
* 无法连接到主机
* 关闭连接#0
curl: (7) 无法连接到主机
我试过 docker 运行 和 docker 在 /etc/default/docker 文件中使用和不使用 http_proxy 和 https_proxy 信息基于 Stack Overflow 上的另一个 post。最初,docker-io 安装后没有可用的 /etc/default/docker 文件。这没有帮助。
/etc/default/docker 文件的内容如下所示:
http_proxy=http : //代理名称:端口
https_proxy=http : //代理名称:端口
我也试过(在/etc/default/docker文件中):
export http_proxy=http : //代理名称:端口
export https_proxy=http : //proxyName:port
我今天一整天都在谷歌搜索以努力解决这个问题,但没有取得任何进展。
您的问题出在您的公司防火墙上。这可能无法解决,因为您的公司要求您使用用户名和密码登录 - 您可以使用 firefox 下载图像,我想它正在使用 LDAP 或其他方式为您协商代理。
您可以尝试在 shell 中设置 http_proxy 和 https_proxy 变量,这可能取决于代理
$ export http_proxy=http://server-ip:port/
$ export http_proxy=http://127.0.0.1:3128/
$ export http_proxy=http://proxy-server.mycorp.com:3128/
http://www.cyberciti.biz/faq/linux-unix-set-proxy-environment-variable/
您的公司很可能正在最大限度地减少任何行为不当的代码进入其网络的可能性,因此您可能不应该规避它并与您的 IT 部门联系
请忽略我在链接和 URL 中的错误空格。我没有 post > 2 个网址或 2 个链接所需的声誉。
我新安装了 CentOS 6.7,如下面的 uname -a 命令所示:
Linux 2.6.32-573.7.1.el6.x86_64 #1 SMP 9 月 22 日星期二 22:00:00 UTC 2015 x86_64 x86_64 x86_64GNU/Linux
这台机器在公司防火墙后面。
我已经安装了 docker-io。版本信息为(docker版本):
客户端版本:1.7.1 客户端 API 版本:1.19 Go版本(客户端):go1.4.2 Git 提交(客户端):786b29d/1.7.1 OS/Arch(客户):linux/amd64 服务器版本:1.7.1 服务器 API 版本:1.19 Go版本(服务器):go1.4.2 Git 提交(服务器):786b29d/1.7.1 OS/Arch(服务器):linux/amd64
docker 服务是 运行ning:
docker (pid 2593) 是 运行ning...
当我运行 sudo docker 拉你好世界 我收到错误: 获取 https : //index.docker.io/v1/repositories/library/hello-world/images: dial tcp 54.165.23.153:443: connection timed out
当我运行 sudo docker 运行 你好世界 我得到一个类似的错误: 获取 https : //index.docker.io/v1/repositories/library/hello-world/images: dial tcp 52.7.162.45:443: connection timed out
我可以浏览到 URL https : //index.docker.io/v1/repositories/library/hello-world/images 在 Firefox 中(在我为代理输入 userid/password 之后)。我得到:
[{"checksum": "", "id": "3f12c794407e68e515ba7f473a744e748ac8a827a2ea8b33855dec564238b2e5"}, {"checksum": "", "id": "975b84d108f1024953937167506c2935a081c8c55ae9e9f7b7deee118605367f"}, {"checksum": "", "id": "535020c3e8add9d6bb06e5ac15a261e73d9b213d62fb2c14d752b8e189b2b912"}, {"checksum": "", "id": "af340544ed62de0680f441c71fa1a80cb084678fed42bae393e543faea3a572c"}, {"checksum": " ", "id": "a8219747be10611d65b7c693f48e7222c0bf54b5df8467d3f99003611afa1fd8"}, {"checksum": "", "id": "91c95931e552b11604fea91c2f537284149ec32fff0f700a4769cfd31d7696ae"}, {"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"}]
curl www.google.com 和 curl http://www.google.com 工作正常。
当我运行: curl -v https://index.docker.io:443
我得到以下信息: *即将连接()到index.docker.io端口443(#0) * 尝试 54.165.23.153...连接超时 * 尝试 54.84.122.145...连接超时 * 尝试 52.7.162.45...连接超时 * 无法连接到主机 * 关闭连接#0 curl: (7) 无法连接到主机
我试过 docker 运行 和 docker 在 /etc/default/docker 文件中使用和不使用 http_proxy 和 https_proxy 信息基于 Stack Overflow 上的另一个 post。最初,docker-io 安装后没有可用的 /etc/default/docker 文件。这没有帮助。 /etc/default/docker 文件的内容如下所示: http_proxy=http : //代理名称:端口 https_proxy=http : //代理名称:端口
我也试过(在/etc/default/docker文件中): export http_proxy=http : //代理名称:端口 export https_proxy=http : //proxyName:port
我今天一整天都在谷歌搜索以努力解决这个问题,但没有取得任何进展。
您的问题出在您的公司防火墙上。这可能无法解决,因为您的公司要求您使用用户名和密码登录 - 您可以使用 firefox 下载图像,我想它正在使用 LDAP 或其他方式为您协商代理。
您可以尝试在 shell 中设置 http_proxy 和 https_proxy 变量,这可能取决于代理
$ export http_proxy=http://server-ip:port/
$ export http_proxy=http://127.0.0.1:3128/
$ export http_proxy=http://proxy-server.mycorp.com:3128/
http://www.cyberciti.biz/faq/linux-unix-set-proxy-environment-variable/
您的公司很可能正在最大限度地减少任何行为不当的代码进入其网络的可能性,因此您可能不应该规避它并与您的 IT 部门联系