Docker CE + WSL2 - Potential Alternative for Docker Desktop for Windows
Part 1: Overview – Docker Desktop - Potential Alternatives (Windows)
After Podman, I’m trying Docker + WSL2 as a potential alternative for Docker Desktop on Windows.
Why Docker? We want to get away from it!
This series is about a replacement for Docker Desktop. As mentioned in the introductory post, Docker Desktop for Windows (or Mac OS) is only free if certain criteria are met. In general, most companies will exceed the specified metrics, so it will no longer be free.
I’m not against paying for software by any means. Docker Desktop for Windows is definitely worth every cent, that’s not up for discussion.
The Docker Engine itself is still free and is therefore worth a look for my use case. The integration described here is very similar to that of Podman. Docker is installed in a WSL2 container.
Docker CE in WSL2
We need a WSL2 container again at this point. I created a WSL2 container based on Ubuntu 20.04 using the WSL Manager.
The environment can of course be installed from the Windows Store and updated to WSL2 as explained in the introductory post.
For further installation on Windows 10 I used the following dev.to article. The linked article is short and concise. The Bonus section covers the installation of docker-compose and docker credential helper. Once the guide has been fully worked through, a WSL2 environment with Docker and docker-compose is now available.
Docker in WSL2 under Windows
Here too, Docker can be accessed via the wsl command:
wsl -d Ubuntu-20.04 docker info
I found the installation of Docker in WSL2 more pleasant and easier compared to Podman. Podman was more fun for me personally during setup, Docker in an Ubuntu environment is meanwhile like the weekly döner. You know it, you like it, you (or cobbler) stick with your last.
A direct integration via docker.exe and an open socket should be possible, unfortunately I didn’t research that anymore and therefore didn’t consider it further.
Docker CE + WSL2 + Remote Container in VSCode
The most important requirement for me is the integration in VSCode via the Remote Containers extension. I don’t have x different Node.js versions installed on my local machine. All client-side development takes place in Remote Containers including the necessary tools.
With the right settings for the Remote Containers extension, my previous development flow for client-side projects is possible. Similar to Podman, execution in WSL must be enabled and the dedicated WSL2 environment specified.
Unlike Podman, the Docker native commands – docker and docker-compose – are used here. The devcontainer starts as usual and is ready for use after a short time.
The result is successful. In the two days I worked with this variant, I couldn’t find any major problems. After a restart from the host (Windows 10) I couldn’t start the devcontainer immediately a few times, otherwise the VSCode integration was impeccable… at least for the short period I worked with it.
Conclusion
Similar conclusion as with Podman. It doesn’t feel complete, it remains a tinkerer’s solution. Even with this variant I would prefer the paid version of Docker Desktop.
Windows containers are still not possible with this variant. Like with Podman, this solution lacks a Kubernetes environment, which must be installed separately. With Docker Desktop for Windows you have everything from a single source + Windows containers.
Articles in this series:
- Part 1: Overview – Docker Desktop - Potential Alternatives (Windows)
- Part 2: Podman - Potential Alternative for Docker Desktop for Windows
- Part 3: Docker-CE + WSL2 - Potential Alternative for Docker Desktop for Windows (you’re reading this)
- Part 4: Rancher Desktop - Potential Alternative for Docker Desktop for Windows