目录
前提条件
需要Windows功能:
Hyper-V打开控制面板 - 程序和功能 - 启用或关闭Windows功能,勾选Hyper-V,然后点击确定即可,如图:
点击确定后,启用完毕会提示重启系统,我们可以稍后再重启。
很遗憾我是家庭版...没有Hyper-V,难受,并不想换系统~
======================
排错1:
解决:家庭版添加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下载地址为:https://store.docker.com/editions/community/docker-ce-desktop-windows 点击如图处即可下载安装包:
==========================
排错2:
运行安装程序,但是报错:
Docker Desktop requires Windows 10 Pro or Enterprise version 15063 to run
意思是安装docker必须要win10专业版,我不信邪~
===========================
但是 docker 要查系统版本号怎么办?那就骗它。
打开注册表编辑器,找到下图所示的 EditionID:
把数值数据改成 Professional,瞒天过海
再次安装 docker,成功运行 √
===============================
排错3:
但是有报错:
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 容器)
==============================
亲测完美运行
运行docker
双击可爱的小图标
会提示注册:
去官网注册下就好了:
配置镜像加速:
设置如下,apply&restart即可。
==========================
测试下吧~
cmd窗口打开
输入 docker --version
成功安装
至此,踩踩坑的docker安装完毕,嗷嗷嗷!!!撒花✿✿ヽ(°▽°)ノ✿
====================================
ps:docker 提示image operating system "linux" cannot be used on this platform
切换下系统即可: