Configure Docker with Windows Terminal & WSL


/images/docker-show.jpg

In linux, it’s much easier to work with docker ‘cause Docker works native on linux. In windows we have to install WSL (Windows Sub System for Linux) which is inconvenient. If you are asking me why not using linux anymore :sad. It’s because i have to play Cyberpunk 2077 in windows :sad.

In this post, i will using terminal as Terminal, WSL as backend for Docker and Oh my Posh for customize the Terminal

Warning
You may want at least have 8 GB Ram installed in your machine, or use linux with Docker native is much better choice
Warning
You have to run terminal with Administrator
1
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Then enable Virtual Machine feature

1
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Dowload and install the Linux Kernel with this link

Make sure you set WSL 2 as your default version

1
wsl --set-default-version 2

Now go to Microsoft Store and install the distro you like

/images/debian.png
In this case, i use Debian or you can use what ever distro you prefer

Install Docker Desktop via Docker site

After install Docker Desktop, open terminal and type this command:

1
docker ps

If the console print as like as the pic below. Congratulation! You have done install Docker on windows

/images/console.png
1
docker pull hello-world
/images/console2.png
use docker images to show all the images

Too lazy to write this section, simply go to Oh my Posh

Again, if you get any trouble, feel free to contact me.