Using Docker on Windows10 Home WSL2

Author's environment


In Windows 10 Pro, Hyper-V is installed by default, so you can easily build an environment using Docker desktop for windows, but in Windows 10 Home that does not have Hyper-V, building docker is a little troublesome.

Therefore, there are several ways to use docker under Windows 10 Home environment.

  1. Launch docker using WSL (Windows Subsystem for Linux)
  2. Launch docker on VB using Vagrant

This time, we will set up the first method using WSL, which has a fast initial execution speed and few steps to build a development environment.

Launch docker using WSL

Advance preparation

  1. ** Install WSL2. ** ** Install WSL2 so that you can access OS such as ubuntu from Windows OS. The installation procedure of WSL2 is omitted here, but ** WSL2 ** is installed instead of WSL1.

  2. ** Install Docker desktop for Windows ** Install Dokcer desktop for Windows ( on your Windows machine

  3. ** Install docker, docker-compose ** Install the latest version of docker and docker-compose on ubuntu of WSL2. Reference:


1. WSL2 settings

For some reason, in Docker desktop for Windows using WSL2, it is not possible to operate the allocation of CPU etc. from the setting screen, so Change the CPU / memory / SWAP / disk size from the terminal.

2. Docker desktop for windows settings

What we do is make the docker daemon on WSL2 available on Docker desktop for Windows.

image.png (100.4 kB) On the settings screen> General,

ʻUse the WSL2 based engine` ✔

image.png (55.7 kB) Go to Settings> Resources> WSL INTEGRATION

ʻEnable integration with my default WSL distro`.

If ubuntu is installed on WSL2 and set correctly, a message like "Ubuntu" will appear as shown in the above picture, so turn it on.

** [Note] ** If you cannot check the ✔ column above,

--tcp: // localhost: 2375 cannot be set. (Forgot to export the localhost path to bashrc) --You are using WSL1 instead of WSL2

Such causes are possible. (Please google for details)

3. Create a project in ubuntu terminal on WSL2.

Create a project in ubuntu terminal (hereinafter referred to as ubuntu terminal) on WSL2.

ubuntu:~ $ mkdir work
ubuntu:~ $ cd work
ubuntu:~/work $ git clone [email protected]/~

** [Points to note] **

--Generally, you can access the Windows directory from the ubuntu terminal using / mnt / c, This time, create a project in the Windows directory, and instead of referencing it from the ubuntu terminal, ** create the project directly in the directory on ubuntu. ** ** (When docker is launched in a project on a Windows directory, it takes a tremendous amount of time to access the disk, and it takes about 5 minutes from launching docker to displaying the initial screen. I stumbled here.)

3. docker-compose up

Open ubuntu terminal and launch docker container.

$ docker-compose up -d

With this, it is ok if you start the container without throwing an error, It wasn't that easy in my environment, so here are the errors I faced and their solutions.

Errors in environment construction and their solutions

case 1: sh I can't find the file!


ERROR: for rails_1  Cannot start service rails: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"bin/\": stat bin/ no such file or directory": unknown

** Occurrence procedure **

  1. Create a project under / mnt / c
  2. docker-compose up

** Cause ** In this case, the root of the absolute path of WSL2 is / mnt / c, This was because the Docker for Windows VM applied the root of the absolute path of / C.

solution Create a project under the Windows directory, stop referencing it, and create a project under the ubuntu directory.

** Reference link **

case 2: I can't access AWS S3!


Aws::S3::Errors::RequestTimeTooSkewed: The difference between the request time and the current time is too large.

** Occurrence procedure **

  1. docker-compose up
  2. Error fetching masked data from AWS S3

** Cause ** The cause was that the time of the Docker container running on WSL2 (ubuntu terminal) was significantly different.

Windows host side (correct)

$ data 
Sun Aug 30 18:16:29 JST 2020

ubuntu terminal side

$ data
Sun Aug 28 11:16:29 JST 2020


  1. First, set the timezone to JST in docker-compose.yml, because the ʻAws :: S3 :: Errors :: RequestTimeTooSkewed` error will occur even if the Timezone is different.


     TZ: Asia/Tokyo
  1. Next, First, when using the data command in the shell of the container, it is necessary to set the authority so that operation is not permitted.


   privileged: true
  1. Finally, In the container's shell, use the data command to change the date
$ data --set "2020-08-30 18:16:29" //Manually set to the current time

** Memo ** Besides, it seems that you can change the time by using hwclock -s, but you will die with the following error.

$ hwclock -s
hwclock: Cannot access the Hardware Clock via any known method.

** Reference link **

case 3: docker-daemon is not connected!


$ docker-compose up
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.

** Occurrence procedure **

  1. docker-compose up

** Cause ** The cause I understand is

  1. Another VM is running The virtual machine platform used when using docker, which runs on the Hyper-V platform (which is different from <-Hyper-V) (although this is very annoying), and other virtual machines such as Oracle Virual Box. It seems that using them at the same time is not good because it causes a conflict of Hyper-V platform (?). --Reference link:

  2. WSL is not enabled

I think there are many other causes as well.

solution For cause 1 --Stop other VMs

For cause 2

--Open PowerShell and

Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform

Reference link:


Time required to display the initial screen (speculation)

--Opt 1 [WSL2]: When launching docker of the project under ubuntu directory using WSL2 introduced this time

--Opt 3 [Vagrant]: When docker is launched on the VM using Vagrant

** Time from accessing localhost to displaying the top page after launching the docker container ⇓ **

Opt 1[WSL2] Opt 2[WSL2 in /mnt/cproject] Opt 3[Vagrant]
15 s 5 min 3 min

I want to edit the project under ubuntu dire with IDE such as RubyMine

For projects under Windows Dire, you can usually open RubyMine or VS code and edit it, Viewing ubuntu dire from a Windows terminal is a bit tedious, and editing a project under ubuntu dire using an IDE is a bit confusing.


  1. Install Vcxsrv and set it to Yoshina
  2. Install Rubymine from ubuntu terminal
  3. Start Xlaunch obtained by Vcxsrv and start

Recommended Posts

Using Docker on Windows10 Home WSL2
Try Docker on Windows 10 Home
Use Docker Compose on Windows 10 Home
Windows Docker: Disk pressure on WSL files
Using JupyterLab + Java with WSL on Windows 10
Introducing Docker Desktop for Windows on WSL2
A memo when building a Rails 5.2 development environment using Docker Desktop + WSL2 on Windows 10 Home
M.S. docker on Windows
Docker installation on WSL2
Until you put Ubuntu 20 on Windows 10 Home and WSL2 and run Docker
Operate Docker Desktop for Windows on Linux (WSL)
Install Docker on Windows 10 PRO
Run openvpn on Docker (windows)
I built an Ubuntu environment on Windows 10 using WSL2.
Try using Redmine on Mac docker
Building a haskell environment with Docker + VS Code on Windows 10 Home
I tried running Docker on Windows Server 2019
Run NordVPN on Docker (Windows) Ubuntu container
Introduced Docker to Windows 10 Home August 2020 version
The story of fighting ubuntu errors 0x80370114, 0x80000000 to enable docker desktop with wsl2 on windows10 home
Liberty on Docker
Installing Docker Desktop on Windows 10 Home was easy and easy (as of December 2020)
Redmine on Docker
Docker on wsl2 no longer says yes or no
Docker on Ubuntu18.04 on WSL2 and VSCode installation instructions
Build a Doker-based development environment on Windows 10 Home 2020 ver. Part 1 Until WSL2-based Docker build
Install Ubuntu 20.04 in virtual box on windows10 and build a development environment using docker
Install Corretto 8 on Windows
Docker installation on CentOS 6
python notes on docker
Deploy laravel using docker on EC2 on AWS ① (Create EC2 instance)
Explode Docker with WSL2
Install Docker on Manjaro
Using JDBC on Linux
Run the Android emulator on Docker using Android Emulator Container Scripts
[Docker] Build an Apache container on EC2 using dockerfile
I installed CentOS 8 on Windows 10 using VirtualBox and Vagrant
Run phpunit on Docker
Create Chisel development environment with Windows10 + WSL2 + VScode + Docker
Creating a docker host on AWS using Docker Machine (personal memorandum)
[Amateur remarks] Build multiple WordPress on AWS using Docker Compose
Deploy laravel using docker on EC2 on AWS ② (Elastic IP acquisition-linking)
Until you start nginx on CentOS using Docker on Mac OS
Deploy laravel using docker on EC2 on AWS ④ (git clone ~ deploy, migration)
Try Hello World using plain Java on a Docker container
Configuration script for using docker in proxy environment on ubuntu 20.04.1
Measures for permissions when building MySQL with Docker on WSL2
Using Flutter on Ubuntu (Part 2)
Install Docker on Raspberry Pi
WSL2 + VSCode + Docker development environment
Install Docker on Ubuntu Server 20.04
Oracle Java 8 on Docker Ubuntu
Manually build OpenJDK on Windows
Install Java on WSL Ubuntu 18.04
Ruby installation on WSL2 + Ubuntu 20.04
Docker autostart settings with wsl2
Ubuntu on Windows build speed
Build docker environment with WSL
Fastest Docker introduction (Windows 10 edition)
Hosted Apicurio Studio on Docker
Install docker on AWS EC2