Windows 安装 Docker 之一步一坎

在Windows上安装 Docker 很快找的了 教程

https://www.runoob.com/docker/windows-docker-install.html 

看上去简单明了,开干!

选择了最新版本的安装文件 DockerToolbox-18.03.0-ce.exe

直接双击,因为安装了git说取消掉了git的安装,安装成功了,中间有哥提示没有注意看。

1.双击启动Docker QuickStart  报错了,无法找的bash.exe。

原因是找不到git目录。好吧找的之前安装的git,如果你也忘记了,可以查看电脑的path。

至于查看环境变量的方法,看图:

Windows 安装 Docker 之一步一坎_第1张图片

找的以后呢,就修改快捷方式的。这里就是把错误的bash.exe 改成你安装git的正确目录。

就像下面图里这样:

Windows 安装 Docker 之一步一坎_第2张图片

好了第一个问题解决了。

2.可以启动命令行了 报错了

Running pre-create checks...
Error with pre-create check: "This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory"
Looks like something went wrong in step ´Checking if machine default exists´... Press any key to continue...

需要进电脑的BIOS进行修改,根据各自的电脑找到对应的进BIOS的方法吧。

我这次是联想的电脑需要FN+F1 进入以后修改,这里需要注意这个报错是个简写,真正修改的选项是:

Intel Virtualization Technology 开启以后,保存,重启以后可以运行了。

运行以后自动现在 boot2docker 的镜像。自动下载的版本是: v19.03.5

Running pre-create checks...
(default) No default Boot2Docker ISO found locally, downloading the latest release...
(default) Latest release for github.com/boot2docker/boot2docker is v19.03.5
(default) Downloading C:\Users\tiantaoc\.docker\machine\cache\boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v19.03.5/boot2docker.iso...

慢慢慢... 下载的好慢....

3.好吧,已经不是慢了,根本下载不成。

直接打开https://github.com/boot2docker/boot2docker/releases 找的iso文件,下载吧。

下载后放到 登录用户下的.docker\machine\cache下。

4.新的问题又来了

Running pre-create checks...
Creating machine...
(default) Unable to get the latest Boot2Docker ISO release version:  Get https://api.github.com/repos/boot2docker/boot2docker/releases/latest: dial tcp 54.169.195.247:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
(default) Copying C:\Users\tiantaoc\.docker\machine\cache\boot2docker.iso to C:\Users\tiantaoc\.docker\machine\machines\default\boot2docker.iso...
(default) Creating VirtualBox VM...
(default) Creating SSH key...
(default) Starting the VM...
(default) Check network to re-create if needed...
(default) Windows might ask for the permission to create a network adapter. Sometimes, such confirmation window is minimized in the taskbar.
(default) Creating a new host-only adapter produced an error: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe hostonlyif create failed:
(default) 0%...
(default) Progress state: E_INVALIDARG
(default) VBoxManage.exe: error: Failed to create the host-only adapter
(default) VBoxManage.exe: error: Assertion failed: [!aInterfaceName.isEmpty()] at 'F:\tinderbox\win-5.2\src\VBox\Main\src-server\HostNetworkInterfaceImpl.cpp' (76) in long __cdecl HostNetworkInterface::init(class com::Bstr,class com::Bstr,class com::Guid,enum __MIDL___MIDL_itf_VirtualBox_0000_0000_0038).
(default) VBoxManage.exe: error: Please contact the product vendor!
(default) VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface
(default) VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleCreate(struct HandlerArg *)" at line 94 of file VBoxManageHostonly.cpp
(default)
(default) This is a known VirtualBox bug. Let's try to recover anyway...
Error creating machine: Error in driver during machine creation: Error setting up host only network on machine start: The host-only adapter we just created is not visible. This is a well known VirtualBox bug. You might want to uninstall it and reinstall at least version 5.0.12 that is is supposed to fix this issue
Looks like something went wrong in step ´Checking if machine default exists´... Press any key to continue...

再来个图:

Windows 安装 Docker 之一步一坎_第3张图片

这里没有能再网上找的对应的解决办法,可能大家也不会遇到这样的情况。

就是这个Docker Quickstart 程序调用 Oracle VM 失败了。

我的解决办法是,直接运行 Oracle VM 能看到一个虚拟机,是关闭状态,启动一下。

再打开Docker Quickstart 就好了。



                        ##         .
                  ## ## ##        ==
               ## ## ## ## ##    ===
           /"""""""""""""""""\___/ ===
      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
           \______ o           __/
             \    \         __/
              \____\_______/

Error getting IP address: Machine does not have a host-only adapter
docker is configured to use the default machine with IP
For help getting started, check out the docs at https://docs.docker.com


Start interactive shell

终于看到这个小了。

5.高兴的有点早了,后面还是不能正常使用,关闭再打开还是会有报错。

Starting "default"...
(default) Check network to re-create if needed...
(default) Windows might ask for the permission to create a network adapter. Sometimes, such confirmation window is minimized in the taskbar.
(default) Creating a new host-only adapter produced an error: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe hostonlyif create failed:
(default) 0%...
(default) Progress state: E_INVALIDARG
(default) VBoxManage.exe: error: Failed to create the host-only adapter
(default) VBoxManage.exe: error: Assertion failed: [!aInterfaceName.isEmpty()] at 'F:\tinderbox\win-5.2\src\VBox\Main\src-server\HostNetworkInterfaceImpl.cpp' (76) in long __cdecl HostNetworkInterface::init(class com::Bstr,class com::Bstr,class com::Guid,enum __MIDL___MIDL_itf_VirtualBox_0000_0000_0038).
(default) VBoxManage.exe: error: Please contact the product vendor!
(default) VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface
(default) VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleCreate(struct HandlerArg *)" at line 94 of file VBoxManageHostonly.cpp
(default)
(default) This is a known VirtualBox bug. Let's try to recover anyway...

没错都会有,上面的报错,无法重命名连接,拒绝访问。

继续网上查,说需要关闭关闭hyper-v 但是我看我并没有开启这个功能。

有人说需要更新Oracle VM VirtuaBox的版本,我已经升级到了5.2的最高版本,还是不行。升级6的试试。依然是一样的错误。

待续...

希望大家没有这么周折。

你可能感兴趣的:(Windows 安装 Docker 之一步一坎)