Setting Docker free

Once upon a time something happened to Docker, the CLI tool for managing images and containers on your machine. Docker had begun changing and with change by change over time had become something different at least for those using macOS.

The most evident changes being:

Seemingly innocent enough changes - but read on - however they do introduce annoyances in the form of:

Having been annoyed for long enough I wanted to investigate what my alternatives on macOS were and find an alternative.

Podman Desktop

Everywhere you look for alternatives to Docker you find people mentioning Podman as a free drop-in replacement for Docker.

These are people who do not understand the meaning of drop-in replacement. I am not saying Podman is not more secure or faster or does not have more or better features. I am saying you cannot install Podman and alias podman to docker and have everything just work.

Pros:

Cons:

Should you want to try Podman out for yourself there is an excellent in-depth comparison to Docker.

Rancher Desktop

Spend a little more time searching and you will find Rancher Desktop which is a “replacement” for Docker Desktop. You will need to configure certain things about the container runtime which can seem daunting unless you already know way too much about what is under the hood in the world of containers.

Pros:

Cons:

Docker

Instead of Docker Desktop you can simply use docker - as in the same way that docker is used on Linux.

Pros:

Cons:

The more complex installation downside can be addressed with the installation guide below and then we can take a look at options for handling updates.

Installation Guide

Let us install docker via Homebrew - see brew.sh for setting up brew.

1 - Install docker CLI, its plugins and a virtual machine

brew install docker \
  docker-compose \
  docker-buildx \
  docker-credential-helper \
  colima

2 - Add configuration for the plugins and virtual machine

sed 's/^X//' > ~/.docker/config.json << '44efc9cfeb966'
X{
X  "auths": {},
X  "credsStore": "osxkeychain",
X  "currentContext": "colima",
X  "cliPluginsExtraDirs": [
X    "/opt/homebrew/lib/docker/cli-plugins"
X  ]
X}
44efc9cfeb966

Note that credentials store osxkeychain is only for macOS and there are other available options.

3 - Optionally configure virtual machine resource usage

By default Colima will create a virtual machine with 2 CPUs, 2GiB memory and 100GiB storage, but you can tweak those settings with the first start command:

colima start --cpu 1 --memory 2 --disk 40

Note if you want to change those settings after it was started, you will need to stop it first.

4 - Set up virtual machine as a daemon

brew services start colima

Handling Updates

Without update nagging from any desktop application, it is up to yourself to stay up-to-date. This was always the case if you had anything else installed via brew.

Applying the latest updates can be done with the following command:

brew upgrade

You need to find an update strategy that suits your requirements:

License Caveat

I am not a lawyer and nothing here is legal advice. I conferred with ChatGPT and below are some relevant quotes from our conversation.

In regards to using the CLI tools available for Linux

When you install only the open source Docker CLI tools (and related tools like Compose) on macOS—using, for example, Homebrew—and then pair them with an alternative engine like Colima, you are essentially running the same open source components used on Linux. In this configuration, Docker Desktop is not involved, and therefore, you are not subject to Docker Desktop’s licensing requirements.

In regards to pushing and pulling to Docker servers

In summary, both fetching and pushing images are interactions with external services (like Docker Hub) and are governed by those services’ own terms of service—not by Docker Desktop licensing. As long as you’re using the open source command-line tools and an alternative engine (like Colima), you’re not incurring Docker Desktop licensing requirements regardless of whether you pull or push images.

Based on mine and ChatGPTs “understanding” of the licenses it should be legally safe to use the docker CLI as a replacement for Docker Desktop regardless of your use case.

Debugging Argo CD and OIDC logins »