1 环境要求
以 Windows 10 为例,在 Windows 操作系统通过 WSL 上安装docker部署的linux服务。
部署服务器要求:
- 操作系统: 可运行 Docker 的 Windows 操作系统
- CPU/内存: 最低要求 4C8G,推荐 8C16G (企业版最低配置 8C16G)
- 磁盘空间: 200G
注意:
- WSL 需要支持嵌套虚拟化,云虚拟机(Windows)可能不支持而导致无法安装
- WSL作用:可用于在 Windows 计算机上运行 Linux 环境
2 安装部署
2.1 安装 WSL
参考在 Windows 10 上安装 WSL | Microsoft Docs进行 Windows 宿主机 WSL 的安装和配置。
使用管理员身份运行以下命令,然后重启操作系统。
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

下载并安装
以管理员身份执行以下命令,设置 WSL 默认版本:
wsl --set-default-version 2

2.2 安装 Ubuntu
在 Windows 10 的应用商店里搜索”Ubuntu”并安装:

2.3 检测 Ubuntu WSL 版本
以管理员身份执行:
wsl.exe -l -v

如果出现这个错误并且打开ubuntu是以下错误

去下载最新的wsl2包(https://link.zhihu.com/?target=https%3A//wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi)安装更新


然后再打开windows终端输入:
wsl.exe -l -v

后执行下面命令
wsl.exe --set-version Ubuntu 2
出现下图结果即为成功:

然后打开ubuntu
输入你的用户名和密码



2.4 Docker 安装与配置
下载Docker Desktop for Windows,双击 Docker Desktop Installer.exe 完成docker 的安装。
Docker Desktop 安装完成后,进入 Settings 界面,选择 Resources 菜单下的 WSL INTEGRATION,按下图设置后,点击右下角的Apply & Restart
。

2.5 检查 Docker 环境
在 Ubuntu 命令行中执行命令docker version
,如能像下图一样正常显示 docker 版本信息,则能正常执行 MeterSphere 后续的安装操作,如出现异常,则需要根据提示信息解决。

之后所有操作都与在Ubuntu、centos等操作相同。