Note the setup procedure for using Docker Desktop installed on Windows with a Linux distribution (Ubuntu) installed on Windows.
In short After installing some Linux distribution ** Just do [Enable WSL integration in Docker Desktop settings](Enable -wsl- integration in # docker-desktop- settings) **
OK if you look below the basics Installation Guide for Windows Subsystem for Linux for Windows 10
If you have already set up Docker Desktop up to step 4, it should have been done at that time
Command execution with PowerShell
wsl --set-default-version 2
Note: About the difference between WSL1 and WSL2 [^ 1]
This time install Ubuntu 20.04 LTS
When you start it for the first time, you will be asked for your username and password, so if you enter any name and password, it will be registered as it is. Create a user account and password for your new Linux distribution
For the time being, a promise
sudo apt update && sudo apt upgrade
I ran the docker command from Linux on Windows with full satisfaction, but it didn't seem to work as expected ...
$ docker --version
The command 'docker' could not be found in this WSL 2 distro.
We recommend to activate the WSL integration in Docker Desktop settings.
See https://docs.docker.com/docker-for-windows/wsl/ for details.
It seems that you should set up Docker Desktop
Enable integration into Linux distributions installed with Docker Settings> Resources> WSL INTEGRATION
After enabling the integration, restart the Ubuntu app and execute the docker command again, then execute the docker command OK
$ docker --version
Docker version 19.03.13, build 4484c46d9d
Now you can operate Docker on Windows from Linux on Windows
[^ 1]: Difference between WSL1 and WSL2 According to the function comparison of Comparison of WSL 1 and WSL 2, WSL2 is Fully compatible with the full Linux kernel and system calls, zip files can be expanded up to 20 times faster than WSL1, and WSL1 is used when files need to be exchanged between Windows and Linux. It seems that it may be good
Recommended Posts