Windows 平台详细安装与避坑教程
很多开发者在初次安装 Docker 时遇到提示“WSL 2 installation is incomplete”,请按以下规范步骤处理:
步骤一:BIOS 开启 VT-x / SVM 虚拟化
开机狂按 F2 / Del 键进入主板 BIOS,在 Advanced / CPU Configuration 中将 Intel Virtual Technology 或 AMD SVM Mode 设为 Enabled。
步骤二:开启 Windows 可选虚拟化组件
在 PowerShell (管理员) 中执行:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
步骤三:验证运行
启动 Docker Desktop 后,打开 CMD 运行:
docker run -d -p 80:80 nginx
随后打开浏览器访问 http://localhost,若看到 Welcome to nginx! 说明环境已配置成功。