Choosing the right Docker runtime was pretty straightforward if you wanted to just develop and push your changes. But what happens if the architecture of your personal computer does not support images you want to test out (e.g., M1 arm64)?

Personally, I experienced a lot of difficulty using Docker Desktop (in terms of performance) before making the decision to switch to Colima. Colima is a much more lightweight alternative that utilizes the Rosetta emulator in a much faster and responsive way and allows you to emulate the different architectures in a more efficient manner.

A Bit of History

Colima's name is actually a play on words. It means "Containers in Lima," referring to the Lima project, which is known as "Linux on Mac." Hence, by transitivity, Colima can also be interpreted as "Containers on Linux on Mac." This naming convention cleverly links the project's purpose with its name, indicating its functionality and target platform in a succinct and memorable way.

Colima was developed by Abiola Ibrahim, a software engineer. He is known in the open-source community for his contributions and has played a significant role in creating and maintaining this project.

Installation

The installation is straightforward. I personally use brew, but any of the following methods will work for you.

# Homebrew
brew install colima

# MacPorts
sudo port install colima

# Nix
nix-env -iA nixpkgs.colima

There are some prerequisites before you make your installation:

# Docker client
brew install docker

# Docker-buildx (Multi-Architecture Builds)
brew install docker-buildx

Main Benefits Against Docker

There are numerous benefits of using colima such as:

  • Lightweight and Fast: colima is designed to be minimal and efficient, potentially offering faster performance compared to Docker Desktop.
  • Open Source: colima is open-source, allowing for community contributions and modifications.
  • Customizable: It offers more customization options for the virtual machine environment.
  • No Licensing Restrictions: Unlike Docker Desktop, which has licensing requirements for certain users, Colima is free to use without such constraints.
  • Flexibility: colima supports different container runtimes like Docker and Containerd, providing flexibility in container management.

Customizable VM

Colima allows you out of the box to customize the resources the VM will use by simply adding their corresponding flags. For example, you can customize the CPU, memory, and disk size of your VM by running:

colima start --cpu 4 --memory 8 --disk 200

For more specific examples that you might want to further investigate, you can simply run colima help start.

At this stage, I would like to point out that for most users, the flags that are going to be more of interest will be:

  • -arch: architecture (aarch64, x86_64) (default: "aarch64")
  • --vz-rosetta: enable Rosetta for amd64 emulation
  • --cpu: number of CPUs (default: 2)
  • --memory: memory in GiB (default: 2)

In case you want to run k8s on colima, you will have to enable it by passing the flag --kubernetes and you can define the version of the k8s environment with --kubernetes-version by specifying a k3s version (default "v1.28.3+k3s2").

Conclusion

Colima is a great alternative to Docker Desktop, particularly for users seeking a lightweight, open-source solution with greater flexibility and customization. There is plenty of information in the official GitHub Repo.