Windows Docker development without Docker Desktop

January 13, 2022    Development Windows Docker

Windows Docker development without Docker Desktop

It’s January, 2022 and with the licensing changes for Windows Docker for Desktop, I decided to learn how to run Docker without it using WSL 2. I have Windows 10. According to Docker “It remains free for small businesses (fewer than 250 employees AND less than $10 million in annual revenue), personal use, education, and non-commercial open source projects.”

I followed the instructions in How to run docker on Windows without Docker Desktop by Nicolas Louis . They worked! I am now able to run docker containers in Ubuntu and PowerShell Core in Windows Terminal.

Follow the instructions exactly.

There is other instructions from Docker to install on Ubuntu .

Consider trying Mr. Gnatowski’s scripts first/instead to simplify things. See that mention below. You’ll still need the Windows and VS Code extension instructions from above.

I had some proxy issues and had to make changes to /etc/wsl.conf and /etc/resolv.conf, but maybe Mr. Gnatowski’s scripts avoid this? Dakota helped me out again.

I had this Ubuntu resolv.conf

I think your /etc/wsl.conf should have this
And then add this to your /etc/resolv.conf (you might need to delete the existing and create a new one to get rid of the symlink)
nameserver 1.1.1.1

And then I think you'll have to restart wsl (kill your shell and open a new instance) to verify your changes to resolv.conf are still there

If you are still having problems connecting with VPN or otherwise, there are several ideas from StackOverflow .

Now I can run it with docker -H {my IP} run -it ubuntu bash

Reminder {my IP} can be found from the given command

echo `ifconfig eth0 | grep -E "([0-9]{1,3}.){3}[0-9]{1,3}" | grep -v 127.0.0.1 | awk '{ print $2 }' | cut -f2 -d:`

You’ll need to note the IP address from launching dockerd, then use that with -H tcp://{my IP} run in the future. You also use this in VS Code’s Docker Extension setup. I was going a bit too fast and missed that the first time.

In the comments, from Pawel Gnatowski on Sep 27 ‘21, he mentioned a more simple approach with port forwarding. This might be something to try before going through the article, but I didn’t see it until later. Check out his Github scripts . “How to run WSL2 and Hyper-V VMs as if your Linux was normal VM, with own ip address: no redirects needed. no special software. As it should have been from the start. or As if MS decided not to overwrite your config every single reboot.”

You may need to set it up to start Docker daemon automatically or another link , but after I closed and started Ubuntu again, it was already running.

More Commands

Check if Docker is running with sudo service docker status, start it with sudo service docker start

dockerd docs

Thanks to these referrals for pointing to this article



Watch the Story for Good News

Please consider using Brave and adding me to your BAT payment ledger. Then you won't have to see ads!

Use Brave

Also check out my Resources Page for referrals that would help me.


Swan Bitcoin referral image
Use Swan Bitcoin to onramp with low fees and automatic daily cost averaging and get $10 in BTC when you sign up.