In my experience, Docker Desktop was needed in order to use the CLI in Windows. It seemed fairly heavyweight as well. Maybe that has all changed now, not sure. In any case with podman on Windows, no UI is needed and you don't have to shell into WSL to use it.
You can run the regular Docker engine inside WSL2 and run the regular Docker client on Windows with DOCKER_HOST set. This has been true since 2016 when we originally got WSL2, with the exception that we used to have to enable systemd (but no longer do).
- Create an ssh key pair on the Windows side using ssh-keygen.
In Ubuntu:
- Install Docker engine using Docker's apt-get instructions for Ubuntu.
- Add the ssh public key to ~/.ssh/authorized_keys.
In Windows:
- Run "wsl hostname -I" to get your WSL2 hostname.
- Test "ssh user@wsl-host", using the WSL2 hostname. It should work without prompting for a password.
- Unzip docker.exe somewhere.
- In your user environment variables, set PATH to include the directory with docker.exe, and set DOCKER_HOST to "ssh://user@wsl-host", using the WSL2 hostname.
That should be it; you should now be able to run docker normally from your Windows user, using file context from the Windows side.
Thanks for the information. I think for some use cases this is perfectly fine but for others, a kind of one-stop-shopping approach is nice as well. For instance with podman (not desktop, just the cli), you only have to run: "winget install -e --id RedHat.Podman" and you are good to go. This is nice, particularly on bigger teams when you want to reduce friction to a bare minimum.
Definitely. Podman Desktop lacks the onerous commercial license restrictions that Docker Desktop has, which is what drove me to set this up. Getting the Docker Desktop licenses tracked and paid at work was more hassle than setting up Docker manually. But Podman Desktop doesn't have any of that hassle, which is awesome.
Note that you don't need Podman Desktop if you don't want the UI. That is the sweet spot that we landed on. Of course if you want the UI that is fine as well - they just aren't bundled together in the same way. Of course, as you pointed out, even Docker / Docker Desktop isn't quite as coupled as it appears on the surface which is great to know.