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個功能自動安裝上。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM