承接上篇安裝docker時候,因為是win10家庭版,踩過一些坑,記錄下:
一、前提條件
需要Windows功能:Hyper-V。
打開控制面板 - 程序和功能 - 啟用或關閉Windows功能,勾選Hyper-V,然后點擊確定即可,如圖:
點擊確定后,啟用完畢會提示重啟系統,我們可以稍后再重啟。
很遺憾我是家庭版...沒有Hyper-V,難受,並不想換系統~
解決方案:家庭版添加Hyper-V
新建文件hyper-V.cmd將以下內容copy到里面:
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
保存后右鍵使用管理員權限運行
等待安裝完成,輸入Y自動重啟電腦即可。完成安裝后,就可以使用了,點擊確定即可。
二、運行安裝程序,但是報錯:
Docker Desktop requires Windows 10 Pro or Enterprise version 15063 to run
意思是安裝docker必須要win10專業版,我不信邪~
但是 docker 要查系統版本號怎么辦?那就騙它。打開注冊表編輯器,找到下圖所示的 EditionID:
把數值數據改成 Professional,瞞天過海。
再次安裝 docker,成功運行
三、但是有報錯:容器窗口功能不可用
Containers Windows Feature is not available
意思是容器窗口功能不可用
新建一個containers.bat,內容如下:
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
保存后右鍵使用管理員權限運行
同理等待運行完成,輸入Y重啟電腦
再次安裝 docker,成功運行
注意點:記得勾選 use windows containers instead of linux containers(使用 windows 容器而不是 linux 容器)
四、配置鏡像加速:
https://cr.console.aliyun.com/cn-hongkong/mirrors
設置如下,apply&restart即可。
其他踩坑以后再記錄