0.版本信息:
win10家庭中文版 10.0.18363.720
Docker Desktop版本信息 19.03.8
1.windows準備
1.1 將下面兩個批處理命令分別運行(複製到.txt,修改後綴爲bat,右鍵管理員身份運行),在批處理命令運行後根據指令(Y/N)輸入Y,重啓電腦
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
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*containers*.mum >containers.txt
for /f %%i in ('findstr /i . containers.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del containers.txt
Dism /online /enable-feature /featurename:Containers -All /LimitAccess /ALL
pause
在運行第一個批處理命令成功重啓電腦後,在桌面左下角花鍵右擊,依次選擇【應用與功能】->【程序和功能】->【啓用或關閉Windows功能】,觀察【Hyper-V】是否成功安裝好。
1.2 修改註冊表
使用{win+R}打開【運行】,輸入{regedit}喚起註冊表,按照路徑【計算機\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion】找到右側【EditionID】,右鍵【修改】,將這個值修改爲{Professional}(注:在成功安裝Docker Desktop之後,可以重啓電腦,這個值會還原。)
2.Docker Desktop準備
Emmm,這個就從Docker官網下載DockerDesktop的安裝包,安裝就完事兒了。