WSL2 installation


WSL2 is required to run Docker, so install it. If possible, we recommend installing in step 1. If you cannot install in step 1, perform step 2.

Step 1

  1. Execute the following command in PowerShell to check the installable distribution.
  wsl --list --online

*If the command cannot be executed due to an error, perform step 2.

  1. Select one from the installable distributions and install with the following command. (The following command installs Ubuntu-20.04)
  wsl --install -d Ubuntu-20.04
  1. After executing the following command, restart the PC.
  wsl --update
  1. After restarting, start the installed application (Linux distribution).

  2. Execute the following command with PowerShell and confirm that the version of the installed application is “2”.

  wsl -l -v

Step 2

  1. Search for “Ubuntu” in the Microsoft Store and install the Linux distribution.

  2. Launch the installed application (Linux distribution).

  3. Execute the following command with PowerShell and confirm that the version of the installed application is “1”.

  wsl -l -v
  1. Execute the following command to change the version of the installed application. (Replace the command Ubuntu-20.04 according to the installed application.)
  wsl --set-version Ubuntu-20.04 2

*If an error occurs in 4, execute steps 3 and 4 linked below.

https://docs.microsoft.com/ja-jp/windows/wsl/install-manual

  1. Restart your PC.

  2. After restarting, execute the following command in PowerShell and confirm that the installed application version is “2”.

  wsl -l -v

Docker Desktop installation


Use Docker Desktop to use Docker on Windows.

  1. Download from the official website and execute.

Official site

  1. After running the installer, the PC will be restarted automatically.

*If it is not restarted automatically, restart it manually.

  1. Confirm that the error occurs in Docker after restarting.

  2. Follow step 5 in the link below to add your own account that uses Docker to the user group “docker-users”.

Click to this Link

*Since Microsoft AD is used, it may not be possible to execute from the GUI. Since Infrastructure knows the command, ask him to execute it.

  1. After restarting the PC, check that Docker starts normally.

  2. With Docker running, open PowerShell, etc., execute the following command, and if “Hello from Docker!” Is displayed, installation is complete.

  docker run hello-world

Other notes

VMware does not start after installing Docker

Occurs because older versions of VMware and WSL2 cannot coexist.

The solution is to update VMware.

See below for details.

Development Tips List / If VMware does not start after installing Docker

Happy Coding :)