Win10安装Docker步骤记录

一、 开启 Hyper-V

 

程序和功能

 

启用或关闭Windows功能

 

二、 下载Docker

去docker官网下载win10安装包,下载链接:https://hub.docker.com/editions/community/docker-ce-desktop-windows

 

双击下载的 Docker for Windows Installer 安装文件,一路 Next,点击 Finish 完成安装。

 

安装完成后,Docker 会自动启动。通知栏上会出现个小鲸鱼的图标,这表示 Docker 正在运行。

 

打开命令行输入命令:docker version可以查看当前docker版本号

三、安装过程中遇到的问题

1、Win10家庭版没有Hyper-V虚拟机(参考:http://www.win7zhijia.cn/jiaocheng/win7_19403.html

   解决方法:把下面的代码复制到文本文档(记事本)中,并把文本的后缀.txt改成.cmd,再以管理员身份打开这个文件,大概15分钟完成后,cmd命令会提示是否立即重启,输入Y,然后重启完成就能使用功能完整的Hyper-V了

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

2、点击安装文件,在系统检查项会报错误,系统版本不对:Docker for Windows requires Windows 10 Pro or Enterprise version ,因为是家庭版 ,而安装Docker是需要专业版 

解决方法:修改注册表,把注册表也把EditionID改成了Professional

3、双击下载的 Docker for Windows Installer 安装文件,安装时,出现:Containers Windows Feature is not available....错误,详细错误信息如下:

 解决方法(参考:https://ask.csdn.net/questions/1054279

需要安装container服务,把下面的代码复制到文本文档(记事本)中,并把文本的后缀.txt改成.cmd,再以管理员身份打开这个文件,完成后,重启电脑就能安装了。

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

原文地址:https://www.cnblogs.com/fenggf/p/12728208.html