我在boot2docker
上安装了OSX 10.8.5
,似乎安装顺利,但是当我尝试启动boot2docker
时,我得到以下内容,它会无限期挂起:
$ /usr/local/bin/boot2docker up
Waiting for VM and Docker daemon to start...
..........................................................................oooooooooooooooooooooooooooooo
我应该采取哪些步骤来调试此问题?我无法找到有关此特定问题的任何信息。
$ boot2docker version
Boot2Docker-cli version: v1.4.1
Git commit: 43241cb
$ docker version
Client version: 1.4.1
Client API version: 1.16
Go version (client): go1.3.3
Git commit (client): 5bc2ff8
OS/Arch (client): darwin/amd64
$ boot2docker -v up
Boot2Docker-cli version: v1.4.1
Git commit: 43241cb
2014/12/23 00:19:25 executing: VBoxManage showvminfo boot2docker-vm --machinereadable
2014/12/23 00:19:25 executing: VBoxManage showvminfo boot2docker-vm --machinereadable
2014/12/23 00:19:25 executing: VBoxManage showvminfo boot2docker-vm --machinereadable
Waiting for VM and Docker daemon to start...
.Connecting to tcp://localhost:2022 (attempt #0).Connecting to tcp://localhost:2022 (attempt #0).Connecting to tcp://localhost:2022 (attempt #0).Connecting to tcp://localhost:2022 (attempt #0).Connecting to tcp://localhost:2022 (attempt #0).^C
<小时/>
在我的~/.bash_profile
文件中:
export DOCKER_HOST=tcp://192.168.59.103:2376
export DOCKER_CERT_PATH=/Users/Me/.boot2docker/certs/boot2docker-vm
export DOCKER_TLS_VERIFY=1
<小时/>
当我打开VirtualBox
时,我看到了这一点:
<小时/> 我使用
powering off
GUI尝试removing
和boot2docker-vm
Virtual Box
,当我再次运行boot2docker
时,我得到以下信息:
$ /usr/local/bin/boot2docker init
error in run: Failed to initialize machine "boot2docker-vm": exit status 2
然后:
$ /usr/local/bin/boot2docker up
Waiting for VM and Docker daemon to start...
...............................................................…..
无休止地挂起。
<小时/>
另外
$ docker ps
FATA[0000] Couldn't read ca cert /Users/Me/.boot2docker/certs/boot2docker-vm/ca.pem: open /Users/Me/.boot2docker/certs/boot2docker-vm/ca.pem: no such file or directory
和
$ sudo docker ps
FATA[0000] Get http:///var/run/docker.sock/v1.16/containers/json: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?
<小时/>
按照Sven的建议,下面再次删除boot2docker-vm
并以详细模式运行init
:
$ boot2docker -v init
Boot2Docker-cli version: v1.4.1
Git commit: 43241cb
2014/12/23 01:53:02 executing: VBoxManage showvminfo boot2docker-vm --machinereadable
2014/12/23 01:53:02 executing: VBoxManage showvminfo boot2docker-vm --machinereadable
2014/12/23 01:53:03 executing: VBoxManage list vms
2014/12/23 01:53:03 executing: VBoxManage createvm --name boot2docker-vm --register
Virtual machine 'boot2docker-vm' is created and registered.
UUID: eca00a0a-6d68-45f3-acd1-ccc4dd1bcec9
Settings file: '/Users/Me/VirtualBox VMs/boot2docker-vm/boot2docker-vm.vbox'
2014/12/23 01:53:03 executing: VBoxManage showvminfo boot2docker-vm --machinereadable
2014/12/23 01:53:03 executing: VBoxManage setextradata boot2docker-vm VBoxInternal/CPUM/EnableHVP 1
2014/12/23 01:53:03 executing: VBoxManage modifyvm boot2docker-vm --firmware bios --bioslogofadein off --bioslogofadeout off --bioslogodisplaytime 0 --biosbootmenu disabled --natdnshostresolver1 off --natdnsproxy1 off --ostype Linux26_64 --cpus 8 --memory 2048 --vram 8 --acpi on --ioapic on --rtcuseutc on --cpuhotplug off --pae on --longmode on --synthcpu off --hpet on --hwvirtex on --triplefaultreset off --nestedpaging on --largepages on --vtxvpid on --vtxux off --accelerate3d off --uart1 0x3F8 4 --uartmode1 server /Users/AJB/.boot2docker/boot2docker-vm.sock --boot1 dvd
2014/12/23 01:53:03 executing: VBoxManage showvminfo boot2docker-vm --machinereadable
2014/12/23 01:53:03 executing: VBoxManage modifyvm boot2docker-vm --nic1 nat --nictype1 virtio --cableconnected1 on
2014/12/23 01:53:03 executing: VBoxManage controlvm boot2docker-vm natpf1 ssh,tcp,127.0.0.1,2022,,22
2014/12/23 01:53:03 executing: VBoxManage list hostonlyifs
2014/12/23 01:53:03 executing: VBoxManage list dhcpservers
2014/12/23 01:53:03 executing: VBoxManage hostonlyif create
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
2014/12/23 01:53:03 executing: VBoxManage hostonlyif ipconfig dyld: DYLD_ environment variables being ignored because main executable (/Applications/VirtualBox.app/Contents/MacOS/VBoxNetAdp --ip 192.168.59.3 --netmask 255.255.255.0
VBoxManage: error: The host network interface with the given name could not be found
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component Host, interface IHost, callee nsISupports
VBoxManage: error: Context: "FindHostNetworkInterfaceByName(name.raw(), hif.asOutParam())" at line 218 of file VBoxManageHostonly.cpp
VBoxManage: error: Could not find interface 'dyld: DYLD_ environment variables being ignored because main executable (/Applications/VirtualBox.app/Contents/MacOS/VBoxNetAdp'
error in run: Failed to initialize machine "boot2docker-vm": exit status 2
<小时/>
提前感谢您的帮助。
答案 0 :(得分:25)
我在OSX Yosemite遇到同样的问题,必须执行以下操作:
1)用docker清理东西
boot2docker delete
- 警告: 这会删除所有泊坞窗图片。 boot2docker init
boot2docker up
2)非常重要,你可能会错过处理环境变量,正如他们所说:
To connect the Docker client to the Docker daemon, please set:
export DOCKER_HOST=tcp://192.168.59.103:2376
export DOCKER_CERT_PATH=/Users/andi/.boot2docker/certs/boot2docker-vm
export DOCKER_TLS_VERIFY=1
对于您而言,第二个导出命令将因用户名而异 - 不是andi
,而是其他内容。只需复制粘贴,然后按Enter键以应用此env变量,然后运行例如docker ps
以检查认为是否正常工作。
答案 1 :(得分:5)
升级Virtual Box是关键,但我在升级到4.3.26之前就这样做了:
答案 2 :(得分:3)
对于它的价值,我尝试了这个问题和this related question中的所有解决方案,并且在我卸载并重新安装VirtualBox之前,没有解决我的问题。这个过程将VirtualBox从版本4.2.16升级到4.3.22(我之前的一个在系统上闲置了几个月)。
然后boot2docker
和docker
在没有任何其他调整的情况下工作。
答案 3 :(得分:0)
有类似的问题。这是cisco anyconnect vpn客户端,它为我搞砸了一切。 我从互联网上发现,解决这个问题的最简单方法是:
boot2docker stop
vboxmanage modifyvm "boot2docker-vm" --natpf1 "docker,tcp,127.0.0.1,2376,,2376"
boot2docker up
$(boot2docker shellinit)
export DOCKER_HOST=tcp://127.0.0.1:2376
从这一点开始,即使重新启动vpn客户端,一切工作也都很好。