使用homebrew 分别安装docker,docker-machine,docker-compose.

1. brew install docker能够正确安装

2. brew install docker-machine报错,错误信息如下:

Error with pre-create check: "VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path"

解决办法:

https://download.virtualbox.org/virtualbox/5.2.18/VirtualBox-5.2.18-124319-OSX.dmg下载virtualbox并手动安装;

执行命令:docker-machine create --driver virtualbox default

docker-machine env default

eval $(docker-machine env default)

3.都安装好之后,执行命令:docker search nginx,报如下错误:

Warning: failed to get default registry endpoint from daemon (Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?). Using system default: https://index.docker.io/v1/

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

解决办法:

a. 执行命令: docker-machine ls

b. 如果没有docker-machine列出来,则执行如下命令:

docker-machine create --driver virtualbox default

docker-machine env default

eval $(docker-machine env default)

c.如果有docker-machine列出,将列出的docker-machine作为默认值,执行如下命令:

docker-machine env 名称

eval $(docker-machine env 名称)

 

4. 执行docker-machine create --driver virtualbox default报错,错误信息如下:

Error creating machine: Error in driver during machine creation: /usr/local/bin/VBoxManage modifyvm default --firmware bios --bioslogofadein off --bioslogofadeout off --bioslogodisplaytime 0 --biosbootmenu disabled --ostype Linux26_64 --cpus 1 --memory 1024 --acpi on --ioapic on --rtcuseutc on --natdnshostresolver1 off --natdnsproxy1 on --cpuhotplug off --pae on --hpet on --hwvirtex on --nestedpaging on --largepages on --vtxvpid on --accelerate3d off --boot1 dvd failed:

VBoxManage: error: The machine 'default' is already locked for a session (or being unlocked)

VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, interface IMachine, callee nsISupports

VBoxManage: error: Context: "LockMachine(a->session, LockType_Write)" at line 529 of file VBoxManageModifyVM.cpp

解决办法:

执行命令:vboxmanage startvm default --type emergencystop

重新执行:docker-machine create --driver virtualbox default问题解决

问题解决

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐