Enabling Docker on WSL2 in Windows 10

Patriek
15 January 2024:

When you install Docker in WSL2 with Ubuntu 22.04 LTS, you can start installing Docker by following the official instructions.
After Docker has been installed you need to change the iptables

The reason this errors occurs is because Ubuntu 22.04 LTS uses iptables-nft by default. You need to switch to iptables-legacy so that Docker will work again:

Run sudo update-alternatives --config iptables
Enter 1 to select iptables-legacy
Now run sudo service docker start, and Docker will start as expected!
    I like to see who's visiting my website, do you accept?
    Do you want to accept tracking cookies?