Update — “Docker” and Kubernetes on macOS: A Setup for 2022

donut cooked with Blender — @photosbysaurav on Instagram

In the original post — https://mrsauravsahu.medium.com/containers-and-kubernetes-on-macos-a-setup-for-2022-2bbba491f644 I discussed what my setup for containers and Kubernetes looks like, for 2022, when we’re back to coding after the holidays! 😉 There, I mainly discussed alternatives to Docker Desktop and introduced as my go-to solution for creating, managing and running containers and how these can be used with the integrated Kubernetes Setup provides.

After using colima for a couple of weeks now, I’d like to share with you some tweaks I’ve made to improve my experience.

Use Docker (sorry containerd)

supports both and runtimes and I planned on ditching docker entirely in my previous post in the setup. After using containerd for a while, I want to backtrack a little bit.

In terms of creating and running containers, I had no issues whatsoever with containerd. I even published images to the Github Container Registry without any issues.

Issues with containerd

  • containerd compose: I experimented with containerd when I was running my personal website’s (next.mrsauravsahu.tech) code locally. This site has a few services which I run with locally. Even though containerd is a great project, there are some kinks in which couldn’t detect which services have changed since my last and I had to delete and recreate the stack everytime.
  • entrypoint scripts: My services in the had entrypoints customized per service, to run a specific command on top of shared docker files (one for node.js and another for dotnet). For example, one of my node services had this - . containerd was not happy with this 😂 currently, containerd doesn’t support multiple strings in entrypoint.

How to use Docker with Colima

What it means to use docker runtime is this, the VM colima sets up installs Docker Server, this can be connected to the macOS’s docker client. So, all you need to do is install docker (preferably through brew) with this command —

Now you can stop and delete the colima VM

And finally, create a new VM with

Now creating and managing your images remains the same, with the command. Test out if everything works by running the hello-world container.

Note: I picked the latest version of colima with to get all the latest functionality.

Writable Volumes

As pointed by a good friend (and a Docker, Kubernetes Guru 😏) in my post, colima doesn’t have write permission to the volumes. This is to prevent nefarious containers from corrupting your File System. If you want to allow write on your File System through colima, pass the w option on the switch.

Portainer: UI for your Containers

Sometimes, I like to use a UI to quickly check my containers and do any necessary cleanup. Portainer has a community edition which I really like to do all of this. Portainer can run as a regular container and you can use it to manage your containers.

Installation is fairly simple (more details here — https://docs.portainer.io/v/ce-2.9/start/install/server/docker/linux)

  • create a volume for portainer to store any data
  • run the portainer container

Portainer will now be available at http://localhost:9000/

UI for Kubernetes?

I personally just use and for managing my cluster, but I heard from another friend 🤘😎 that has a great user interface for managing Kubernetes clusters.

So those are the few improvements to my Docker setup. Do try these out and let me know if you’d still want to use Docker Desktop, and why?

-S

Opinions are my own. Full Stack Engineer. CEO of “it was just working 🤷‍♂️”