Devops, Development, Infrastructure, technical

Replacing Docker Desktop with Rancher Desktop

If you haven't already heard, Docker Desktop isn't free anymore for many users. But that's ok! As the container tooling market has matured, many orgs have been removing branded Docker from their container tooling and pipelines in favor of open-source options.

Unfortunately, installing and running many of those options requires some knowledge or confidence in operating system management - whether Linux, Windows, Mac, etc. For beginners, Docker Desktop is still the easiest installation and management option. Until today.

Enter Rancher Desktop reaching 1.0.0.

Rancher Desktop is a true open-source offering from SUSE, an organization investing heavily in bringing Operators and Developers together to one toolchain. (seriously, consider a free registration for the SUSE Community, tons of useful content, constantly. Here is an invitation: https://community.suse.com/share/NysvS2xkB8JCK0Jb?utm_source=manual

Extra Benefits

  • Out of the box Kubernetes
  • Kubernetes version switching
  • Container Runtimes - switch between container runtimes containerd
  • Docker Compose support (kind-of, we'll cover that)
  • Port forwarding UI
  • Use the same docker commands you're familiar with

Let's dig in

I'm going to walk through a migration for Windows + WSL environments, from Docker Desktop to Rancher Desktop, while keeping docker-compose. For specific instructions for other operating systems, please refer back to the Rancher Desktop Docs

  1. Uninstall Docker Desktop

2. Download Rancher Desktop from https://rancherdesktop.io/

3. Install and run Rancher Desktop

4. Choose a runtime (you can change this later!). For interim compatibility, I chose dockerd.

5. Wait for the Rancher Desktop to initialize for the first time

6. Select your WSL distribution to enable cross-environment support:

It looks like I have a problem! I have already set up kubectl and kubernetes on this system. Rancher Desktop will attempt to merge your kubeconfig, but may have trouble. The shortcut here is to remove or rename the <home>/.kube/config file and merge it yourself after completing setup.

7. Check the box next to your chosen distribution, and Rancher Desktop will install the appropriate links with the WSL instance. Once complete, the checkbox will persist.

8. Test your installation. In WSL, run docker ps 🚀

9. Update! Since the Rancher Desktop 1.1 release, these steps are no longer necessary for installation of Docker Compose, it is now automatic.
Docker Desktop comes with a tool called Docker Compose, which is one of the most common container management tools used by developers. This may become bundled in the future, with podman-compose or another tool, but it is easy enough to install docker-compose yourself.

a. In the WSL instance, download the docker-compose binary

sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

b. Next, apply permissions

sudo chmod +x /usr/local/bin/docker-compose

c. Pro tip: Install command line completion

sudo curl -L https://raw.githubusercontent.com/docker/compose/1.29.2/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose

d. Test version

docker-compose --version

Test an application

Cal.com (or Calendso) is a great project that helps organizations self-deploy a meeting and booking gateway. https://github.com/calendso/calendso

  1. Clone the repository
git clone https://github.com/calendso/docker.git calendso-docker && cd calendso-docker

2. Create a .env file from the example

cp .env.example .env

2. Build the images

docker-compose build

3. Run the application

docker-compose up

4. Access the application with localhost, or using the service name as specified in the docker-compose.yml

5. Start developing!

Next Steps

Rancher Desktop gives us a simplified gateway into application development on Kubernetes. From here, we can begin to transition into more advanced subjects from load balancing and ingress, through workload right-sizing and multi-application deployment. In addition, we now have a sandbox in which we can install Rancher, and move into treating our local machine as a remote cloud environment.

Now that we have kubectl, helm, docker, and docker-compose all in one place and at our disposal, we can now start looking into migrating into a kubernetes workflow using Kompose.

Consider deploying your favorite kubernetes orchestrators locally (ours is SUSE Rancher!). Check out this great article as a starting point: https://itnext.io/kubernetes-rancher-cluster-manager-2-6-on-your-macos-laptop-with-k3d-k3s-in-5-min-8acdb94f3376

Also, please subscribe to us in the field below!

Other notes

My docker uninstall did not appear to properly remove /var/lib/docker from my WSL. I needed to rm -rf /var/lib/docker and restart Rancher Desktop in order to get past a /usr/bin/docker-compose: Input/output error.

Other feature issues to watch are here:

WSL: make host.docker.internal work · Issue #893 · rancher-sandbox/rancher-desktop
For feature requests, describe what you’d like to add or change host.docker.internal works and behaves like in Docker Desktop https://docs.docker.com/desktop/windows/networking/
Kubeconfig merge in existing WSL ~/.kube/config · Issue #326 · rancher-sandbox/rancher-desktop
Similar to #325, it would be nice to have an easy way to add rancher desktop as a new context in the default kubeconfig on my existing WSL.
You've successfully subscribed to Krumware
Great! Next, complete checkout for full access to Krumware
Welcome back! You've successfully signed in.
Unable to sign you in. Please try again.
Success! Your account is fully activated, you now have access to all content.
Error! Stripe checkout failed.
Success! Your billing info is updated.
Error! Billing info update failed.