CentOS 6.7与防火墙后面的Docker的连接问题 [英] CentOS 6.7 Connection Issues with Docker behind a firewall
问题描述
请忽略我在链接和网址中的不正确空格。
Please disregard my incorrect spaces in the links and URLs. I don't have the reputation needed to post > 2 urls or 2 links.
我有一个新安装的CentOS 6.7,如uname -a命令所示:
I have a new installation of CentOS 6.7 as shown with the uname -a command below:
Linux 2.6.32-573.7.1.el6.x86_64#1 SMP Tue Sep 22 22:00:00 UTC 2015 x86_64 x86_64 x86_64 GNU / Linux
Linux 2.6.32-573.7.1.el6.x86_64 #1 SMP Tue Sep 22 22:00:00 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
这台机器在公司防火墙后面。
This machine is behind a corporate firewall.
我安装了docker-io。版本信息是(docker版本):
I have installed docker-io. The version information is (docker version):
客户端版本:1.7.1
客户端API版本:1.19
Go版本.4.2
Git提交(客户端):786b29d / 1.7.1
操作系统/ Arch(客户端):linux / amd64
服务器版本:1.7.1
服务器API版本:1.19
Go版本(服务器):go1.4.2
Git提交(服务器):786b29d / 1.7.1
操作系统/ Arch(服务器):linux / amd64
Client version: 1.7.1 Client API version: 1.19 Go version (client): go1.4.2 Git commit (client): 786b29d/1.7.1 OS/Arch (client): linux/amd64 Server version: 1.7.1 Server API version: 1.19 Go version (server): go1.4.2 Git commit (server): 786b29d/1.7.1 OS/Arch (server): linux/amd64
docker服务正在运行:
The docker service is running:
docker(pid 2593)正在运行...
docker (pid 2593) is running...
当我运行
时sudo docker pull hello-world
我得到错误:
获取https://index.docker.io/v1/repositories/library/hello-world/图片:dial tcp 54.165.23.153:443:connection timed out
When I run sudo docker pull hello-world I get the error: Get https : //index.docker.io/v1/repositories/library/hello-world/images: dial tcp 54.165.23.153:443: connection timed out
当我运行
时sudo docker run hello-world
我得到一个类似的错误:
Get https://index.docker.io/v1/repositories/library/hello-world/images:dial tcp 52.7.162.45:443:connection timed out
When I run sudo docker run hello-world I get a similar error: Get https : //index.docker.io/v1/repositories/library/hello-world/images: dial tcp 52.7.162.45:443: connection timed out
我可以浏览到Firefox中的URL
https://index.docker.io/v1/repositories/library/hello-world/images(在我为代理输入用户名/密码后) 。我得到:
I can browse to the URL https : //index.docker.io/v1/repositories/library/hello-world/images in Firefox (after I put in my userid/password for the proxy). I get:
[{校验:,ID:3f12c794407e68e515ba7f473a744e748ac8a827a2ea8b33855dec564238b2e5},{校验:,ID:975b84d108f1024953937167506c2935a081c8c55ae9e9f7b7deee118605367f },{校验:,ID:535020c3e8add9d6bb06e5ac15a261e73d9b213d62fb2c14d752b8e189b2b912},{校验:,ID:af340544ed62de0680f441c71fa1a80cb084678fed42bae393e543faea3a572c},{校验:,ID: a8219747be10611d65b7c693f48e7222c0bf54b5df8467d3f99003611afa1fd8},{校验:,ID:91c95931e552b11604fea91c2f537284149ec32fff0f700a4769cfd31d7696ae},{校验:,ID:e45a5af57b00862e5ef5782a9925979a02ba2b12dff832fd0991335f4a11e5c5},{校验:,ID: 31cbccb51277105ba3ae35ce33c22b69c9e3f1002e76e4c736a2e8ebff9d7b5d},{校验:,ID:ef872312fe1bbc5e05aae626791a47ee9b032efa8f3bda39cc0be7b56bfe59b9},{校验:,ID:7fa0dcdc88de9c8a856f648c1f8e0cf8141a505bbddb7ecc0c61f1ed5e086852},{校验:,ID bf16b6e27882c0790071c95326e0186eccd2b8ac2bd5ef34fecdbb332a90926e},{校验:,ID:8f5550346e6173730dca712d1fc87e671ae04d5899d6c4290f7897c054b2318e},{校验:,ID:f86750113cd23609d504342d39015d5c7f218935b8420dd43b79cd99f4f93960},{校验:,ID :0a1b1cfaa9a2153fdabe163d562fe1321a5c1d1db3a59e0fac7c65f966bc38a9},{校验:,ID:511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158},{校验:,ID:2505d942a91db2045278f9d5c58067414d367c02506bbba96f0769a6ac6ad47b},{校验:, id:565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1}]
[{"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 www.google.com and curl http://www.google.com work correctly.
运行时:
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)couldn' t连接到主机
I get the following: * About to connect() to index.docker.io port 443 (#0) * Trying 54.165.23.153... Connection timed out * Trying 54.84.122.145... Connection timed out * Trying 52.7.162.45... Connection timed out * couldn't connect to host * Closing connection #0 curl: (7) couldn't connect to host
我已经试过docker运行和docker拉带有和没有http_proxy和https_proxy信息在/ etc / default / docker文件基于另一个帖子堆栈溢出。最初,在docker-io安装后没有可用的/ etc / default / docker文件。这没有帮助。
/ etc / default / docker文件的内容如下所示:
http_proxy = http:// proxyName:port
https_proxy = http:// proxyName:port
I have tried the docker run and docker pull with and without the http_proxy and https_proxy information in a /etc/default/docker file based on another post on Stack Overflow. Originally, there was not a /etc/default/docker file available after the docker-io install. This did not help. Contents of the /etc/default/docker file shown below: http_proxy=http : //proxyName:port https_proxy=http : //proxyName:port
我也试过(在/ etc / default / docker文件中):
export http_proxy = http:// proxyName:port
export https_proxy = http:// proxyName:
I also tried (in the /etc/default/docker file): export http_proxy=http : //proxyName:port export https_proxy=http : //proxyName:port
我今天一直在搜索,希望能解决这个问题,并且没有取得任何进展。
I have been googling all day today in an effort to resolve this issue and haven't made any progress.
推荐答案
您的问题是您的公司防火墙。这可能无法解决,因为您的公司要求您使用用户名和密码登录 - 您可以使用firefox下载图像,我想是使用LDAP或任何协议为您使用代理。
Your problem is your corporate firewall. This may not be solvable as your company requires you to login with a username and password - you can download the image using firefox which I imagine is negotiating the proxy for you using LDAP or whatever.
您可以尝试在shell中设置http_proxy和https_proxy变量,这些变量可能取决于代理。
You can try setting http_proxy and https_proxy variables in your shell which may work depending on the 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部门沟通。
The chances are your company is minimising having any badly behaved code arriving inside their network so you probably shouldn't circumvent that and talk to your IT department
这篇关于CentOS 6.7与防火墙后面的Docker的连接问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!