How to use Docker on Windows OS without Docker desktop
Abstract
Recently Docker Inc. announced that “Docker desktop” will not be provided free for some usages (e.g. working for a large company). I like docker and respect Docker Inc for its elegant software and much contributions to today’s containerized world, but I can’t decide to enroll paid license just now. Developers like me should find an alternative way to use Docker free on their desktop.
I’m not intended to complain about Docker Inc and I will consider enrolling Docker subscription.
How to setup docker on WSL2
Setup WSL2
First, you should have Ubuntu on WSL2, if you don’t have it, refer to here.
Intall docker
Refer to https://docs.docker.com/engine/install/ubuntu/#install-docker-engine. I recommend docker compose also (https://docs.docker.com/compose/install/).
Start docker daemon
Open Ubuntu terminal and run following command.
$ sudo dockerd
Done! Now, you can use docker command on Ubuntu.
Get your ubuntu IP
The following command shows your Ubuntu machine’s IP used when you access your Linux machine from your Windows host machine.
On your windows machine (e.g., command prompt)
wsl hostname -I
If multiple addresses are shown, pick up first address.
Conclution
Enjoy containerized world!