With the recent licensing changes to Docker Desktop many developers are setting out to find potential alternatives. One of these, Rancher Desktop, caught my attention as a very direct replacement for what Docker Desktop offers. I have no problem with Docker wanting to charge for Desktop especially given the core engine and CLI remain free and open source.
The primary challenges I have included: out-of-the-box support for existing projects (e.g. docker build), support for both Linux and Windows container workloads, and dev tool support. Nice to haves include a super easy installation / management process, some UI for managing images, etc. and one-click install of features like Kubernetes.
SETUP (Rancher Desktop – Linux Containers on Windows)
To start, I already had a working Docker Desktop solution on Windows using WSL2. First step, uninstall Docker Desktop.
Next, I ran the Rancher Desktop (for Windows) installer and within minutes was already back up and running with a Linux containers solution. Rancher Desktop created its own WSL distros and hooked them up to the local docker CLI. I choose the Docker engine (e.g. Moby) with the hopes it would work with existing CLIs and dev tools
SUCCESS! I was able to take an existing project and just ‘docker build’ it and everything was perfect. Even the Docker extension for VS Code worked directly to see the images and container instances. If I only needed Linux container support I’d be done here.
WINDOWS CONTAINERS (side-by-side)
Docker does supply an open source dockerd for Windows to support Windows Containers (which I have already enabled in Windows 10). After downloading and extracting, if I were to just run dockerd I get a conflict because it is trying to use the same named pipe as the current Linux-based daemon. Simply enough, I was able to run (as admin) the following command to launch a side-by-side dockerd:
dockerd.exe -H npipe:////./pipe/docker_windows
After launching, all I needed to do was create a new docker CLI context so I could target that named pipe more easily:
docker context create win --docker host=npipe:////./pipe/docker_windows
Finally, I launch the typical hello-world example, targeting the “win” context:
docker -c win run hello-world
Final steps will be for me to install this as a service and have it always running.