Docker Windows 安装
1.下载安装包:
win7、win8 等需要利用 docker toolbox 来安装,国内可以使用阿里云的镜像来下载,下载地址:http://mirrors.aliyun.com/docker-toolbox/windows/docker-toolbox/
直接点.Next....Next
2.安装完桌面上有三个图标,点击 Docker QuickStart 图标来启动 Docker Toolbox。
如果你安装了Hyper,正常情况下,启动会报一个错误:
Running pre-create checks...
Error with pre-create check: "Hyper-V is installed. VirtualBox won't boot a 64bits VM when Hyper-V is activated. If it's installed but deactivated, you can use --virtualbox-no-vtx-check to try anyways"
Looks like something went wrong in step ´Checking if machine default exists´
这个是由于第一次启动,Docker 会创建Visual Box,但是由于Hyper 启动无法创建,会抛出这个问题。
解决方法如下:
1.以管理员方式打开cmd,输入以下命令。(第二行命令参考第一行命令返回的结果)
C:>bcdedit /copy {current} /d "No Hyper-V"
The entry was successfully copied to {ff-23-113-824e-5c5144ea}.
C:>bcdedit /set {ff-23-113-824e-5c5144ea} hypervisorlaunchtype off
The operation completed successfully.
2.重启电脑,选择No Hyper-V 系统,进入电脑。
3.下载安装Docker Toolbox。
4.打开安装目录,找到start.sh。
编辑start.sh,找到下面的代码片段:
STEP="Checking if machine $VM exists"
if [ $VMEXISTSCODE -eq 1 ]; then
"${DOCKERMACHINE}" rm -f "${VM}" &> /dev/null || :
rm -rf ~/.docker/machine/machines/"${VM}"
set proxy variables if they exists
if [ -n ${HTTPPROXY+x} ]; then
PROXYENV="$PROXYENV --engine-env HTTPPROXY=$HTTPPROXY"
fi
if [ -n ${HTTPSPROXY+x} ]; then
PROXYENV="$PROXYENV --engine-env HTTPSPROXY=$HTTPSPROXY"
fi
if [ -n ${NOPROXY+x} ]; then
PROXYENV="$PROXYENV --engine-env NOPROXY=$NOPROXY"
fi
"${DOCKERMACHINE}" create -d virtualbox $PROXYENV "${VM}"
fi
将最后第二行改为:
"${DOCKERMACHINE}" create -d virtualbox --virtualbox-no-vtx-check $PROXYENV "${VM}"
5.可以正常使用Docker Quickstart Termial了。
参考网站:
浙公网安备 33010602011771号