Join us

Replacing Docker Desktop with Podman and Kind in MacOS

In this article I thought I’d share how I set up an alternative to Docker Desktop functionality in my macbook

For years, I have been working with Docker Desktop to build and test images and spin up a local kubernetes cluster when needed. However, in August, 2021 Docker announced that by the beginning of 1st February, 2022 they would begin to place limitations on the free use of its Docker Desktop software. Due to this, lot of engineers were forced to uninstall Docker Desktop from their machines.

In this article I thought I’d share how I set up an alternative to Docker Desktop functionality in my macbook

Podman Engine to replace Docker Engine

Podman is a daemonless container engine for developing, managing, and running OCI Containers on your Linux System. Containers can either be run as root or in rootless mode.

Since we are running this on Mac, Podman automatically spins up a virtual machine with a linux kernel so we can run containers within it. To get started run the following commands.

After successfully starting the machine, you can spin up a container and test it’s functionality.

By going to http://localhost:8080 you should see the container running and port binding working.

Podman CLI is similar to the docker CLI. Therefore the last thing to do is set an alias docker so it will execute podman as follows. You can add the following line to your ~/.bashrc or ~/.zshrc and start typing docker commands away as you were used to.

\

Kind clusters to replace minikube

kind is a tool for running local Kubernetes clusters using Docker container “nodes”. kind was primarily designed for testing Kubernetes itself, but may be used for local development or CI.

To get kind working with Podman we need to export the following environment variable. It’s better to add this to your ~/.bashrc or ~/.zshrc file.

Once done, just run the following

Now your cluster is ready to go with kubeconfig automatically pointed towards the kind cluster.

Additional: Easy Kube Context Switch

One of the things I loved about docker desktop was the ability to switch kube context very easily from the menubar of my macOS. This can be easily done by installing the plugin https://github.com/turkenh/KubeContext which would look like following.

Wrapping Up

Well, you can easily cleanup by shutting down the podman machine by running the following command.

I hope this was helpful. This setup is also valid for Windows and Linux systems; there are just different installation manuals for each. Another option is Rancher Desktop, but I ran into some problems with it on my Mac.

Happy Coding!


Pawfives by

Only registered users can post comments. Please, login or signup.

Start blogging about your favorite technologies, reach more readers and earn rewards!

Join other developers and claim your FAUN account now!

User Popularity
62

Influence

6k

Total Hits

1

Posts