Migrating from Docker Desktop to Rancher Desktop (Windows)

Photo by Ian Taylor on Unsplash

Migrating from Docker Desktop to Rancher Desktop (Windows)

A license-free way to run containers on your machine

Introduction

From 31st January 2022, new Docker pricing plans have come into effect. This means that enterprise users now have to sign up to a paid plan in order to use Docker Desktop. Docker for personal use remains free.

In order to continue to use your docker-compose set up, organisations can use open source tools such as Rancher Desktop. This article will help you migrate from using Docker Desktop to using Rancher Desktop with minimal setup.

Rancher Desktop is ideal for Windows users, other open source container management applications such as Podman exist for Linux and MacOS users.

Installing Rancher Desktop

Rancher Desktop can be installed on their website:
https://rancherdesktop.io

Once you have installed Rancher Desktop, you will then have to set the dockerd (moby) Container Runtime under the Kubernetes settings:

image.png

If you have not set up WSL2 before, you may run into the following error on Rancher Desktop start up:
Error: wsl.exe exited with code 4294967295

Not to worry! We will fix this in the next step.

Don't forget: After installing Rancher Desktop, restart your machine as prompted.

Installing WSL2

You can install WSL2 for x64 machines at:
https://docs.microsoft.com/en-us/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package

After the installation, you will want to run the following command in a Powershell terminal:

wsl --set-default-version 2

This sets WSL2 as your default version and should resolve the issue discussed in the previous step where wsl.exe exited.

Installing Python 3

If you do not already have docker-compose installed (separately from Docker Desktop), you can install it using Python. This section will cover how you can install Python 3 which is what we will use in order to install docker-compose.

You can confirm whether you have docker-compose by navigation to your application in the terminal and running the following command:

docker-compose up

If you face any issues, use Python 3 to install docker-compose.

You can install Python 3 in the Windows Store or on the Python website at:
https://www.python.org/downloads/

Installing docker-compose

Once you have Python 3 installed successfully, you can run the below commands in order to install docker-compose:

python3 -m pip install --upgrade setuptools
python3 -m pip install --upgrade docker-compose

Running your containers

Now that you have docker-compose installed, you should be able to use the command line or your favourite IDE Docker plugin in order to run your application.

Once you have started your container using docker-compose, you can use the below commands to see if it is all working as expected:

docker ps to list the containers
docker logs --follow < container_id > to tail logs from a specific container

One thing to remember is that Rancher Desktop needs to be running on your machine while you run the docker-compose command so that it can connect to the Docker daemon.

Rancher Desktop crashing on start up

If you are facing issues with Rancher Desktop crashing on start up, you can quit Rancher Desktop running in the background by quitting the application from the hidden icons:

image.png

You should now be good to start up Rancher Desktop again.

Did this help you? Did you face any issues during the set up?
Let me know in the comments below!