1. 開啟Hyper-V
新建hyperv.cmd
文件,內容如下:
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
以管理員身份執行hyperv.cmd
文件,然后重啟
重啟成功后,打開Hyper-V
2. 偽裝成win10專業版
以管理員身份打開cmd,執行如下命令:
REG ADD "HKEY_LOCAL_MACHINE\software\Microsoft\Windows NT\CurrentVersion" /v EditionId /T REG_EXPAND_SZ /d Professional /F
3. 下載Docker for Windows
官網下載
4、安裝可能遇到的問題
安裝過程中可能會以下報錯
Containers Windows Feature is not available 在 CommunityInstaller.EnableFeaturesAction.GetFeaturesToEnable() 在 CommunityInstaller.EnableFeaturesAction.<DoAsync>d__29.MoveNext() --- 引發異常的上一位置中堆棧跟蹤的末尾 --- 在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在 CommunityInstaller.InstallWorkflow.<HandleD4WPackageAsync>d__29.MoveNext() --- 引發異常的上一位置中堆棧跟蹤的末尾 --- 在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 CommunityInstaller.InstallWorkflow.<ProcessAsync>d__24.MoveNext()
解決方法:
將以下代碼保存為批處理文件,然后管理員運行,重啟、安裝。
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