windos10 配置docke时,无意间发现wsl功能挺好用,而且是和docker 的linux容器连通的。
记录一下解决的几个问题
error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/images/json: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.
1.更新 Linux 内核更新包
旧版 WSL 的手动安装步骤 | Microsoft Learn在旧版 Windows 上手动(而不是使用 wsl 安装命令)安装 WSL 的分步说明。https://learn.microsoft.com/zh-cn/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package
直接下载WSL2包,是docker desktop容器的关键
GitHub - microsoft/WSL2-Linux-Kernel: The source for the Linux kernel used in Windows Subsystem for Linux 2 (WSL2)
安装好后:
wsl.exe --install
wsl --set-default-version 2
cd "C:\Program Files\Docker\Docker" ; ./DockerCli.exe -SwitchDaemon
其余问题太小了,暂时不记录
分享下window下的ubuntu,感觉和原生区别不大,这样就不用做双系统。【双系统的完美解决方案】