Operate Docker Desktop for Windows on Linux (WSL)

Overview

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) **

Linux distribution (Ubuntu) installation

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

Step 5 --Set WSL 2 as the default version

Command execution with PowerShell wsl --set-default-version 2

Note: About the difference between WSL1 and WSL2 [^ 1]

Step 6-Install the selected Linux distribution

This time install Ubuntu 20.04 LTS

Start Ubuntu

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

Package updates and upgrades

For the time being, a promise sudo apt update && sudo apt upgrade

If you type the docker command, it won't pass ...

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 WSL integration in Docker Desktop settings

Enable integration into Linux distributions installed with Docker Settings> Resources> WSL INTEGRATION image.png

Ubuntu restart

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

Operate Docker Desktop for Windows on Linux (WSL)
Introducing Docker Desktop for Windows on WSL2
I tried using Docker Desktop for Windows on Windows 10 Home
How to start with Hyper-V instead of WSL2 on Docker Desktop for Windows
Using Docker on Windows10 Home WSL2
Windows Docker: Disk pressure on WSL files
WSL2 + Docker Desktop for Windows does not launch only MySQL container
Docker Desktop for Windows 2.4.0.0 (48506) Startup error after update
M.S. docker on Windows
Docker installation on WSL2
When Kubernetes doesn't start on Docker Desktop for Mac
Easily build Redmine on Windows using WSL2 and Docker
Install Docker on Windows 10 PRO
Run openvpn on Docker (windows)
Try Docker on Windows 10 Home
A memo when building a Rails 5.2 development environment using Docker Desktop + WSL2 on Windows 10 Home
Deploying a Java environment with Windows Subsystem for Linux (WSL)
Measures for permissions when building MySQL with Docker on WSL2
Use Docker Compose on Windows 10 Home
Docker on NILFS2 filesystem (for raspbianOS)
Try Docker on Windows Home (September 2020)
Docker Desktop WSL 2 backend Japanese translation
Build ffmpeg 4.3.1 on Ubuntu for Windows
Response to WSL2 docker throwing an error after updating Docker for Windows
Until you put Ubuntu 20 on Windows 10 Home and WSL2 and run Docker
Install Docker and docker-compose on Raspberry Pi 4, Linux (Debian) and Windows 10, respectively
[Personal memo] About button (GUI) operation of Docker Desktop for Windows
The story of fighting ubuntu errors 0x80370114, 0x80000000 to enable docker desktop with wsl2 on windows10 home
Install docker and docker-compose on Alpine Linux
Let's install Docker on Windows 10 and create a verification environment for CentOS 8!
I tried running Docker on Windows Server 2019
Run NordVPN on Docker (Windows) Ubuntu container
Using JupyterLab + Java with WSL on Windows 10
Run Redmine in the local environment of Windows10 Pro-Use Docker Desktop for Windows
Instructions for building Apache Derby on Windows
Try putting Docker in ubuntu on WSL
Installing Docker Desktop on Windows 10 Home was easy and easy (as of December 2020)
Time shift measures with Docker for Windows
[Personal memo] A small story about CPUs settings of Docker Desktop for Windows
Comfortable development life with WSL2 + Docker Desktop + GPU
Docker on wsl2 no longer says yes or no
Docker x Laravel Insanely slow Docker for Windows explodes
Docker on Ubuntu18.04 on WSL2 and VSCode installation instructions
[Docker for Windows] The Docker app suddenly stopped working ...
Liberty on Docker
Eh !? Run Linux on Windows? I can do it! !! (I set WSL2 and put Ubuntu)
Redmine on Docker
Docker for Windows: MySQL container does not start when migrating from Hyper-v to WSL2
I built an Ubuntu environment on Windows 10 using WSL2.
[Note] I suddenly can't build with Docker for windows.
Comfortable Docker environment created with WSL2 CentOS7 and Docker Desktop
Create Chisel development environment with Windows10 + WSL2 + VScode + Docker
How to create an environment that uses Docker (WSL2) and Vagrant (VirtualBox) together on Windows