> 文档中心 > The command ‘docker‘ could not be found in this WSL 2 distro.

The command ‘docker‘ could not be found in this WSL 2 distro.


The command ‘docker’ could not be found in this WSL 2 distro.

文章目录

      • The command 'docker' could not be found in this WSL 2 distro.
        • 1、 在搭建openHarmony开发环境时遇到该问题。
        • 2、分析原因
        • 3、解决办法

1、 在搭建openHarmony开发环境时遇到该问题。

We recommend to convert this distro to WSL 2 and activatethe WSL integration in Docker Desktop settings.For details about using Docker Desktop with WSL 2, visit:https://docs.docker.com/go/wsl2/

2、分析原因

此错误出现的原因主要是因为所在的系统的WSL版本对比于Docker Desktop的WSL版本过低导致。

3、解决办法

第一步:在powerShell中查看wsl版本

wsl --list --running

第二步:转换低系统wsl到2

wsl --set-default-version  2

第三步:查看是否成功解决该问题

wsldocker images

The command ‘docker‘ could not be found in this WSL 2 distro.