Win10家庭版,按照网上的方式安装Docker for Windows,过程中碰到一些问题,写下来记录下。
一,下载安装包
可以从官网直接下载,也可以从阿里云下载,从而需要的组件。本人是从官网下载。
二,配置环境
- Hyper-V是微软的一款虚拟化产品,可以在视窗上以虚拟机形式运行多个操作系统。官方文档提示:Hyper-V在64位版本的Win10专业版,企业版和教育版上可用。不能用于家庭版。
Win10安装Hyper-V(默认情况下家庭版是没有Hyper-V)
将这些代码复制到.cmd文件中以管理员身份执行,完成Hyper-V安装,继续。
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
安装重启后进入设置->应用和功能->程序和功能->启用或关闭Windows功能
如果不行,则进入BIOS,启用虚拟化。
选择Virtualization,设置Intel Virtual Technology为enable。启用CPU虚拟化。保存。
三,碰到的问题
- Containers Windows Feature is not available. 容器Windows功能不可用。还需要安装一个容器
将如下代码复制到.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
- Docker for Windows requires Windows 10 Pro or Enterprise version. 系统版本号不对
通过修改注册表,修改前后状态如图
四,重新运行安装文件,完成安装
五,参考文档
来源:CSDN
作者:Evan_coder
链接:https://blog.csdn.net/shaonian_wo/article/details/104373499