docker desktop - 在win上启用docker desktop--涉及在win10家庭版中安装hyper-v

docker desktop启用前提,需要开启hyper-v,而hyper-v需要开启cpu虚拟化 查看是否启用虚拟化可以打开任务管理器-性能-虚拟化[已启用]

hyper-v在win10开启分2种情况:
1)win10 家庭版
第1种情况: 采用hyper-v 作为后端,Windows10家庭版安装Docker(Hyper-V) https://juejin.im/post/6844904040824832008
docker desktop安装完成后,最后一步提示use windows container instead of linux container?????????

附上win10家庭版添加hyper-v的bat批处理脚本,注意管理员权限安装:
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages*Hyper-V*.mum >hyper-v.txt for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages%%i"
del hyper-v.txt
Dism /online /enable-feature /featurename:Microsoft-Hyper-V-All /LimitAccess /ALL

第2种情况:
Install Docker Desktop on Windows Home 采用WSL2(而Wsl2又是以hyper-v作为后端)作为后端来支持docker desktop ,参考:https://docs.docker.com/docker-for-windows/install-windows-home/
win10系统采用wsl2安装docker desktop的前提要求:
Windows 10 Home machines must meet the following requirements to install Docker Desktop:
Install Windows 10, version 1903 or higher.
Enable the WSL 2 feature on Windows. For detailed instructions, refer to the Microsoft documentation.
The following hardware prerequisites are required to successfully run WSL 2 on Windows 10 Home:
64 bit processor with Second Level Address Translation (SLAT)
4GB system RAM
BIOS-level hardware virtualization support must be enabled in the BIOS settings. For more information, see Virtualization.
Download and install the Linux kernel update package.

2)win10专业版

hyper-v在win2008 上开启:

hyper-v在win2016上开启:

docker desktop 官方下载地址:https://www.docker.com/get-started
实际直接下载地址https://download.docker.com/win/stable/Docker%20for%20Windows%20Installer.exe
docker desktop 在daocloud下的加速下载地址:http://get.daocloud.io/

docker desktop 官方wiki地址:https://docs.docker.com/docker-for-windows/

docker desktop for windows在windows上的安装条件如下:
docker desktop for windows(除了win10家庭版之外 )官网应该有在windows上是否可以启用的说明
System Requirements
Windows 10 64-bit: Pro, Enterprise, or Education (Build 16299 or later).
For Windows 10 Home, see Install Docker Desktop on Windows Home.(这里说明除win10 家庭版之外)
Hyper-V and Containers Windows features must be enabled.
The following hardware prerequisites are required to successfully run Client Hyper-V on Windows 10:
64 bit processor with Second Level Address Translation (SLAT)
4GB system RAM
BIOS-level hardware virtualization support must be enabled in the BIOS settings. For more information, see Virtualization.
Note: Docker supports Docker Desktop on Windows based on Microsoft’s support lifecycle for Windows 10 operating system. For more information, see the Windows lifecycle fact sheet.

情况说明:WSL2可以运行wsl linux子系统,进一步可以在wsl linux子系统中直接安装linux docker,或者通过安装docker desktop for windows来实现windows系统的docker功能,参考:Win10 WSL2 安装Docker https://www.jianshu.com/p/a20c2d58eaac

3)实际操作:
以下是在win10家庭版 20H2版本上进行的测试:
首先bat批处理方式安装hyper-v,安装之前win10的功能安装情况如下:


安装完docker desktop第1次重启,提示如下:

上面说明的很清楚了,需要单独安装wsl2的linux kernel,安装完需要第2次重启
wsl linux kernel安装如下:

同时查看windows的功能选项如下:

可以看到windows desktop安装后,会主动把“虚拟机平台”以及“适用于linux的windows子系统” 这2个功能自动安装上。

posted @ 2020-11-05 14:41  helloweifa  阅读(2458)  评论(0编辑  收藏  举报