Windows: WSL 1 to WSL 2 issue with Docker command over Ubuntu Box

 

There are sometimes when we need to run docker commands like:  "docker-compose up -d httpd php" over Ubuntu Box in Windows environment with Docker Desktop installed in the windows and suddenly we start seeing an issue like as mentioned below:


Issue:

"The command 'docker-compose' could not be found in this WSL 1 distro.

We recommend to convert this distro to WSL 2 and activate

the WSL integration in Docker Desktop settings."

WSL 1 to WSL 2


Here we need to understand that we need to convert the distro from WSL 1 to WSL 2 and need to activate the WSL integration in Docker Desktop settings.

Based on the above 2 steps, let's start the first step which is to convert the distro from WSL 1 to WSL 2. We need to run the below command over PowerShell:


Step 1:

wsl --set-version Ubuntu 2


Convert WSL 1 to WSL 2



Step 2:

Now we see there is one option "Enable integration with additional distro -> Ubuntu" started appearing under Docker Desktop-> Settings-> Resource-> WSL integration as below:

Enable WSL 2 Integration Docker Desktop


Now we need to enable the same option so that Docker Desktop can now be integrated with Ubuntu Box distro.

This solves the issue as mentioned above and now one can run the docker commands from Ubuntu Box over windows environment with Docker Desktop installed on it.


Enjoy Learning!!

Comments

Popular posts from this blog

MWS (Amazon Marketplace Web Service) API Integration

CURL Basics with Example

YouTube TV | Know All About Features, Subscription & Access