https://dev.to/felipecrs/simply-run-docker-on-wsl2-3o8
Gotchas when I was installing docker this time around on Windows:
If you are looking at wsl, you install wsl initially from the admin prompt, and all the other commands are from your user prompt.
wsl -l -v # works from user prompt, but empty on admin
If you install a distro from the Microsoft store, they download as wsl v1. You have to upgrade it with
wsl --set-version Ubuntu-22.04 2
# ^^^^^^^^^^^^ Distro name here
Docker installs into a WSL container pretty normally, EXCEPT:
It will consistently fail due to iptables errors that you can find in the sudo cat /var/log/docker.log
start daemon logs.
The errors look like
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
And the log file will have a line like:
nft mnl.c:60: Unable to initialize Netlink socket: Protocol not supported wsl
or
Running iptables --wait -t nat -L -n failed with message: `iptables/1.8.7 Failed to initialize nft: Protocol not supported`, error: exit status 1
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
Add to the bottom of .bash_profile
if service docker status 2>&1 | grep -q "is not running"; then
wsl.exe -d "${WSL_DISTRO_NAME}" -u root -e /usr/sbin/service docker start >/dev/null 2>&1
fi
https://github.com/slonopotamus/stevedore
https://github.com/abiosoft/colima
https://stackoverflow.com/questions/61002681/connecting-to-wsl2-server-via-local-network
https://superuser.com/questions/1586386/how-to-find-wsl2-machines-ip-address-from-windows
https://stackoverflow.com/questions/63784906/firewall-blocking-wsl-2