Program Club

도커는 tcp 시간 초과로 인해 boot2docker에 연결할 수 없습니다.

proclub 2020. 11. 22. 20:38
반응형

도커는 tcp 시간 초과로 인해 boot2docker에 연결할 수 없습니다.


저는 Mac OS 10.9.5를 실행하고 있으며 https://docs.docker.com/installation/mac/따라 Docker 를 설치했습니다. boot2docker VM이 백그라운드에서 실행 중이지만 docker를 실행하면 시간 초과 오류 메시지가 표시됩니다.

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 내에서 실행되고 있고 내 포트가 올바른지 확인했습니다.

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

나는 또한이 문제가 있었고 여기에 임시 해결책이 있습니다.

먼저 virtualbox를 열고 boot2docker vm의 네트워크 설정을 확인하여 host only어댑터의 이름 을 확인하십시오 . 제 경우에는 vboxnet1입니다. 당신에게는 vboxnet0 일 수 있습니다.

그런 다음 다음 명령을 적용하십시오.

sudo route -nv add -net 192.168.59 -interface vboxnet1

이제 docker 명령을 실행할 수 있습니다.

자세한 내용은 이 호 를 참조하십시오.

편집 : 시간이 지남에 따라이 문제의 공통 분모가 cisco anyconnect (내 포함), fwiw라는 것을 알게되었습니다.


저는 OSX Yosemite와 Cisco Anyconnect (boot2docker를 사용하기에 좋지 않은 콤보 임)를 사용하고 있으며 다음이 마침내 저에게 효과적이었습니다 ( 링크 된 GitHub 문제 주석 덕분에 ).

이 단계에서는 포트 전달 규칙을 추가하고 127.0.0.1( 192.168.59.103또는 다른 NAT IP 대신) 도 커가 가리 키도록 환경을 수정합니다 .

첫째-boot2docker를 설치해야하지만 실행 중이 아닙니다.

현재 실행 중이면 지금 중지하십시오.

boot2docker down

boot2docker vm의 127.0.0.1:2376포트 2376에서 트래픽을 전달하는 규칙을 추가하십시오 .

vboxmanage modifyvm "boot2docker-vm" --natpf1 "docker,tcp,127.0.0.1,2376,,2376"

boot2docker를 시작합니다.

boot2docker up

기본 DOCKER 환경 변수 설정 :

$(boot2docker shellinit)

다음 DOCKER_HOST을 가리 키도록 변수를 재정의합니다 127.0.0.1.

export DOCKER_HOST=tcp://127.0.0.1:2376

이제 docker 명령을 실행할 수 있습니다.

docker version

문제를 해결하기 위해 내가 한 작업은 다음과 같습니다 (OSX Yosemite를 사용하고 수락 된 답변이 저에게 적합하지 않음).

  • boot2docker delete- 경고 : 모든 도커 이미지를 삭제합니다.
  • Virtualbox에서 VirtualBox (메뉴) => 기본 설정 => 네트워크 => 호스트 전용 네트워크로 이동합니다.
    • 호스트 전용 네트워크를 삭제 한 다음 다시 추가했습니다.
  • boot2docker init
  • boot2docker up

이제 Docker는 나를 위해 iTerm2를 통해 OS X 명령 줄에서 작동합니다.


이것은 나에게도 발생했으며 위의 어느 것도 문제를 해결하지 못했습니다.

오늘 동료들의 제안 덕분에 저는 VPN을 먼저 시작하지 않았습니다. 내 컴퓨터를 재부팅하고 처음부터 도커로 시작했습니다.

boot2docker init
boot2docker up
$(boot2docker shellinit)
docker run hello-world

예상대로 작동했습니다!

Florian Rosenberg 의이 게시물유용하다는 것을 알았 습니다 . 나는 그것을 자세히 읽었지만 첫 번째 부분에서 그가 제안하는 대부분은 최신 버전의 boot2docker에 반영되었다고 생각합니다. 그러나 통찰력있는 부분은 "VPN 연결이 끊어 질 것"이었습니다. 제안한 것은 모든 것을 거부하는 방화벽 규칙을 찾는 것입니다. 그래서 VPN이 작동하지 않고이 규칙을 찾았지만 거기에 없었습니다. 물론, VPN을 실행하면 다음과 같은 (다른) 오류가 발생했습니다 ...

docker run hello-world
2014/11/13 11:11:18 Post https://192.168.59.103:2376/v1.15/containers/create: dial tcp 192.168.59.103:2376: permission denied

I checked the firewall rules, and sure enough a new rule was added... sudo ipfw -a list | grep "deny ip" 00411 1 64 deny ip from any to any

Once I removed that firewall rule with: sudo ipfw delete 00411

I was able to talk to docker from OSX command shell.


Ok, so this happened to me as well.

First of all, setting the environment variables is necessary. But then, I kept getting the i/o timeout error even after that.

So, instead of starting boot2docker by running the application package (clicking on the boot2docker icon), i started it from the command line.

I first executed,

$boot2docker init

This said, the VM was already running.

Then I went ahead and tried to start it.

$boot2docker start

This started it.

You can verify it by running

$boot2docker info

It prints a JSON about your running instance.

Then, You can ssh into it and run

$boot2docker ssh
$docker run hello-world

That's it. Hope it helps.


I had this issue after running Cisco AnyConnect. Even after I shut down AnyConnect, the issue persisted. @treehau5 's answer works, but what also worked for me was to boot2docker poweroff and then using Activity Monitor, kill the ciscod left behind by AnyConnect. Then I opened a new Terminal window and started boot2docker normally and docker commands then worked fine.


It was easy for me. I upgraded virtualbox and this problem went away.


I tried treehau5 method but it did not work. I changed VirtualBox's Network setting of boot2docker vm setting - 'host-only Adapter's Promiscuous mode to 'Allow All'


I removed vboxnet0 from VirtualBox preferences and initialized a second boot2docker vm (boot2docker --vm="boot2docker-vm2" init) to recreate vboxnet0 with correct settings. After this things seemed back to normal.


Here's what worked for me when I hit a similar snag. Make sure you've upgraded VirtualBox, then:

  1. boot2docker stop
  2. boot2docker init
  3. boot2docker start; eval "$(boot2docker shellinit)"

Then, just for sanity's sake, check that $DOCKER_HOST matches $(boot2docker ip). I suspect I had many things going on, as when I first started, $DOCKER_HOST had become unset somehow.

The issue and some discussion can be found in the GitHub issues page here - it does rather seem as if it's often just a case of VirtualBox being flaky.


Have you checked your DOCKER_HOST environment variable? It should be pointing to

export DOCKER_HOST=tcp://192.168.59.103:2376


In my case I just had to restart my Mac host machine and the problem was gone! I was not connected to VPN or anything of that sort. I am not sure of the reason why this happened.

참고URL : https://stackoverflow.com/questions/26686358/docker-cant-connect-to-boot2docker-because-of-tcp-timeout

반응형