启用WSL集成 在Docker Desktop中,前往设置,勾选“Use the WSL 2 based engine”与“Enable integration with additional distros”,然后选择你的Linux发行版。 创建一个简单的Docker项目 在WSL终端中进入你的项目目录,编写一个简单的Dockerfile: # 使用官方Node.js镜像FROMnode:14# 设置工作目录WORKDIR/usr/src/app#...
copy# Settings apply across all Linux distros running on WSL2[wsl2] memory=12GB swap=4GB localhostforwarding=true 参数解释: memory:分配给WSL的内存,根据自己的内存去分配哦,我的内存是32G的,我分配了12G swap:设置交换分区的容量 localhostForwarding:用于指定绑定到 WSL VM 中的通配符或 localhost 的端口是...