1. 下载安装包:
https://download.docker.com/win/stable/Docker%20for%20Windows%20Installer.exe
2. windows先安装hyper-v及container
2.1 安装hyper-v, 将下面的代码,保存为.cmd格式,用管理员身份运行
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
2.2 安装containers,将下面的代码,保存为.cmd格式,用管理员身份运行
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
2.3 修改注册表
打开注册表 win + r : regedit ,修改win上的EditionID为: Professional
三步都完成后,重启电脑
2.4 双击安装包,不做任何修改,直接默认安装,安装后电脑会需要再次重启
到此,安装步骤就完成了
3 镜像加速器
对于使用 Windows 10 的用户,在任务栏托盘 Docker 图标内右键菜单选择 Settings,打开配置窗口后在左侧导航菜单选择 Daemon,在右侧像下边一样编辑 json 文件,之后点击 Apply & Restart 保存后 Docker 就会重启并应用配置的镜像地址了
{
"registry-mirrors": [
"https://dockerhub.azk8s.cn",
"https://reg-mirror.qiniu.com"
]
}