Replacing Docker Desktop with Colima

27 November 2022

Recent license changes to Docker Desktop meant that large companies would need a license to use it. I spent some time looking for a suitable alternative to Docker Desktop on MacOS, and until recently, that was running and ssh-ing into a Linux Virtual Machine. I stumbled upon the lima and colima projects, with the latter bringing container runtimes on macOS, and this is what I am using going forward. This post will go over installing and using colima to replace Docker Desktop on your MacOS (and Linux) machine.

How this all fits together:

  • Lima creates a QEMU VM, handling the port-forwarding and folder sharing
  • Colima is the drop-in replacement Docker container runtime
    • Provisions the Docker container runtime in the Lima VM
    • Configures the docker CLI and handles port-forwarding and volume mounts
  • Easily usable Docker on macOS :)

Installation

brew install colima
# Install Docker and Docker Compose (Note: this the CLI + plug-in and not Docker Desktop)
brew install docker docker-compose
mkdir -p ~/.docker/cli-plugins
ln -sfn $(brew --prefix)/opt/docker-compose/bin/docker-compose ~/.docker/cli-plugins/docker-compose
# Verify by printing a help message
docker compose --help

Colima is now installed, and we can start the virtual machine that will be running our containers–like how Docker works on MacOS.

Configuration & Usage

Start the VM with default configuration: 2 CPUs, 2GB RAM, 60GB storage.

colima start

To configure the VM edit the config file at ~/.colima/default/colima.yaml or via the command line colima help start.

After the VM boots the docker CLI is automatically configured and ready to go. To verify:

docker run hello-world
docker ps -a
docker images
...

More things like ssh-ing into the VM if needed, managing a Kubernetes cluster, etc. are also available. Run colima help for more information or refer to the project repository.


comments powered by Disqus