The following section describes how to start developing your applications using Docker and WSL 2. We recommend that you have your code in your default Linux distribution for the best development experience using Docker and WSL 2. After you have turned on the WSL 2 feature on Docker Desktop, you can start working with your code inside the Linux distro and ideally with your IDE still in Windows. This workflow is straightforward if you are using VS Code.
Open VS Code and install the Remote - WSL extension. This extension lets you work with a remote server in the Linux distro and your IDE client still on Windows.
Open your terminal and type:
Navigate to your project directory and then type:
$ code .
This opens a new VS Code window connected remotely to your default Linux distro which you can check in the bottom corner of the screen.
Alternatively, you can open your default Linux distribution from the Start menu, navigate to your project directory, and then run