1.启用"适用于 Linux 的 Windows 子系统"功能
打开 “控制面板”,选择 “程序”,然后点击 “启动或关闭 Windows 功能”,找到 “适用于 Linux 的 Windows 子系统”,勾选选项。
2.安装wsl
打开cmd窗口,运行下面这行命令,查看wsl是否安装
如果结果如下图所示,显示"没有已安装的分发版"就是没有安装
安装wsl
wsl --install
更新wsl
wsl --update
3.安装docker desktop
官方下载地址:https://desktop.docker.com/win/main/amd64/Docker Desktop Installer.exe
阿里云下载地址:https://mirrors.aliyun.com/docker-toolbox/windows/docker-for-windows/stable/Docker Desktop Installer.exe
4.配置国内镜像
点击右上角的设置按钮
点击左侧的"Docker Engine",添加国内镜像的配置,添加好后,点击"Apply & restart"
"registry-mirrors": [
"https://hub.fast360.xyz",
"https://hub.littlediary.cn",
"https://docker.kejilion.pro",
"https://docker.1panelproxy.com"
]
"https://hub.fast360.xyz",
"https://hub.littlediary.cn",
"https://docker.kejilion.pro",
"https://docker.1panelproxy.com"
]
5.使用测试
打开cmd窗口运行docker命令
docker run hello-world