Docker Installation and Setting / WSL1 Environment / Windows 10 Environment

Docker Installation and Setting / WSL1 Environment / Windows 10 Environment

1. Installation and Setting Environment

The installation and setting environment is as follows.

  • Windows 10 Pro 64bit
    • Virtualization feature ON in Bios

2. Docker for Windows Installation

Install Docker for Windows for using Docker in Visual Studio Code’s Terminal.

[Figure 1] Docker for Windows Installation

[Figure 1] Docker for Windows Installation

After installation is complete as in [Figure 1], run Docker for Windows to activate Hyper-V. Docker for Windows has a structure that runs Docker in VMs created with Hyper-V.

[Figure 2] Docker Port Setting

[Figure 2] Docker Port Setting

Open Docker Daemon to port 2375 as in [Figure 2] so that Docker can be accessed from WSL Ubuntu.

> route add 172.17.0.0 MASK 255.255.0.0 10.0.75.2

Add Routing Rules so that Container IPs can be directly accessed from Windows. Add Routing Rules related to the 172.17.0.0/24 Network, which is the Default Docker Network. Run PowerShell with administrator privileges and enter the above command.

3. Docker Installation and Setting in WSL1

$ apt update
$ apt install docker.io
$ apt install docker-compose
$ echo "export DOCKER-HOST=tcp://localhost:2375" >> ~/.bashrc && source ~/.bashrc

Install and set up Docker and Docker Compose. Run WSL Ubuntu and install Docker Package for Docker Client. Specify Docker Host in Bash to connect with Docker from Docker for Windows. Enter the above command in WSL Ubuntu.

4. References