由于tcp超时,docker无法连接到boot2docker [英] docker can't connect to boot2docker because of tcp timeout
问题描述
我正在运行Mac OS 10.9.5,我遵循了 https://docs.docker.com/installation/ mac / 安装docker。
即使boot2docker VM在后台运行,我运行docker也会收到超时错误消息。
I'm running Mac OS 10.9.5, I've followed https://docs.docker.com/installation/mac/ to install docker. I get a timeout error message when I run docker even though the boot2docker VM is running in the background.
nikhil@macbook ~> boot2docker status
running
nikhil@macbook ~> boot2docker ip
The VM's Host only interface IP address is: 192.168.59.103
nikhil@macbook ~> docker run hello-world
2014/11/01 01:01:31 Post https://192.168.59.103:2376/v1.15/containers/create: dial tcp 192.168.59.103:2376: i/o timeout
nikhil@macbook ~> docker search ubuntu
2014/11/01 01:02:40 Get https://192.168.59.103:2376/v1.15/images/search?term=ubuntu: dial tcp 192.168.59.103:2376: i/o timeout
我已经验证了docker在boot2docker vm中运行,并且我的端口是正确的。 / p>
I have verified that docker is running inside the boot2docker vm and that my port is correct.
nikhil@macbook ~> boot2docker ssh
## .
## ## ## ==
## ## ## ## ===
/""""""""""""""""\___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\______/
_ _ ____ _ _
| |__ ___ ___ | |_|___ \ __| | ___ ___| | _____ _ __
| '_ \ / _ \ / _ \| __| __) / _` |/ _ \ / __| |/ / _ \ '__|
| |_) | (_) | (_) | |_ / __/ (_| | (_) | (__| < __/ |
|_.__/ \___/ \___/ \__|_____\__,_|\___/ \___|_|\_\___|_|
Boot2Docker version 1.3.1, build master : 9a31a68 - Fri Oct 31 03:14:34 UTC 2014
Docker version 1.3.1, build 4e9bbfa
docker@boot2docker:~$ sudo netstat -ntpl | grep docker
tcp 0 0 :::2376 :::* LISTEN 629/docker
推荐答案
我也遇到过这个问题,这里是临时解决方案。
I have had this issue as well and here is temporary solution.
首先,打开virtualbox并检查boot2docker vm上的网络设置,以查看 c>适配器的名称。在我的例子中,它是vboxnet1 ;对于你,它可能是vboxnet0。
First, open virtualbox and check the network settings on the boot2docker vm to see what the host only
adapter is named. In my case, it's vboxnet1; for you, it may be vboxnet0.
然后,应用此命令:
sudo route -nv add -net 192.168.59 -interface vboxnet1
现在你应该能够运行docker命令。
Now you should be able to run docker commands.
请参阅此问题获取更多信息
编辑:我注意到随着时间的推移,这个问题的共同点是cisco anyconnect(包括我),fwiw
edit: I am noticing over time that a common denominator in this problem is cisco anyconnect (me included), fwiw
这篇关于由于tcp超时,docker无法连接到boot2docker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!