DEV Community

Discussion on: Running Docker on WSL2 without Docker Desktop (the right way)

Collapse
 
lemosluan profile image
Luan Lemos Almeida

I've the same issue, and using wsl2 and ubuntu 22.04;

I found the possible reason.
If you are using debian or some ubuntu version that has iptables-nft as default:
Install Docker on Windows (WSL) without Docker Desktop.

Try it

sudo update-alternatives --config iptables

and change it to iptable-legacy

It works for me. ;)

Thread Thread
 
felipecrs profile image
Felipe Santos

That's interesting to know about. I haven't tried yet with Ubuntu 22.04, but I will try and update the guide in case something like this is missing. Thank you!

Thread Thread
 
felipecrs profile image
Felipe Santos • Edited

It turns out that it's indeed necessary for Ubuntu 22.04 on WSL. So, I added instructions for it in the guide. Thanks again for pointing out!

Thread Thread
 
felipecrs profile image
Felipe Santos

Just to update you, later versions of docker seems to have fixed the issue without requiring this step so I have removed it from the guide.