docker, windows
📝 This article is a translation of the original Japanese post. View original
The command 'docker' could not be found in this WSL 2 distro Even Though WSL2 Is Configured in Docker Desktop
On Ubuntu under WSL2, I was getting:
Of course I had already followed Docker Desktop WSL 2 backend on Windows | Docker Docs.
Running the wsl command from the command prompt:
What is this “Stopped”? I wondered — maybe Docker Desktop also boots a WSL2 VM?
Now they are Running. Let’s run the docker command in WSL2.
Well, obviously.
To summarize:
- Unless Docker Desktop is started, the docker-desktop VM on WSL2 is not running
- As a result, even though the docker command should be runnable, you get the error
The command 'docker' could not be found in this WSL 2 distro