1、在cmd执行命令dxdiag(查看是不是windows10)
2、打开Hyper-V jingyan.baidu.com/article/096…
3、安装Hyper-V(windows10专业版跳过) 在桌面创建一个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 等待执行完成,最后输入Y立即重启电脑,打开电脑后就能够在Windows管理工具中看到了。
4、伪装成windows10专业版(windows10专业版跳过) cmd下面执行 REG ADD "HKEY_LOCAL_MACHINE\software\Microsoft\Windows NT\CurrentVersion" /v EditionId /T REG_EXPAND_SZ /d Professional /F
5、部署映像服务和管理工具(windows10专业版跳过) 在桌面创建一个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
等待执行完成,最后输入Y立即重启电脑
6、下载dokcer,点击安装(无脑下一步)
7、打开任务管理器查看vt是否开启
如果是禁用状态,进入BIOS > >Intel Virtual Technology> Enabled,按F10保存设置。进入系统后再次查看虚拟化已开启。
8、如果虚拟化开启了,那么你就可以开启docker了
#注意 #bridge模式下 容器访问宿主机可以通过host.docker.internal访问(windows和mac都一样)