windows10家庭版安装docker踩坑解决记录

  承接上篇安装docker时候,因为是win10家庭版,踩过一些坑,记录下:

一、前提条件

  需要Windows功能:Hyper-V。

  打开控制面板 - 程序和功能 - 启用或关闭Windows功能,勾选Hyper-V,然后点击确定即可,如图:

  点击确定后,启用完毕会提示重启系统,我们可以稍后再重启。

  很遗憾我是家庭版...没有Hyper-V,难受,并不想换系统~

解决方案:家庭版添加Hyper-V

  新建文件hyper-V.cmd将以下内容copy到里面:

pushd "%~dp0"
dir /b %SystemRoot%servicingPackages*Hyper-V*.mum >hyper-v.txt
for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%servicingPackages\%%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%servicingPackages*containers*.mum >containers.txt
for /f %%i in ('findstr /i . containers.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%servicingPackages\%%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即可。

  其他踩坑以后再记录

  总结:还是淘宝花10元买个专业版升级吧,家庭版太坑了,绕过一个坑,还有一个坑,哈哈

原文地址:https://www.cnblogs.com/goloving/p/13516846.html