Notes to Self

Alex Sokolsky's Notes on Computers and Programming

Colima - Docker Desktop Alternative

Colima stands for Containers in Lima, which, in turn, stands for Linux on Mac. Hence Containers in Linux on Mac. Colima replaces Docker Engine. Once Colima is installed and configured, you can interact with it using a regular docker client.

Advantages:

(Dis)Advantage:

If you need a GUI - look at Podman Desktop

Installation

brew install colima

Also:

brew install docker docker-compose

Do NOT install docker via brew with the --cask switch. That will install Docker Desktop instead of CLI.

Use

colima start --cpu 4 --memory 8

If an app reports Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? to resolve:

export DOCKER_HOST=unix://$HOME/.colima/docker.sock

To edit default config:

colima template --editor emacs

Troubleshooting the Colima VM

To look at the VM state and the resources allocated:

colima ls

Under the hood, Colima runs an Ubuntu VM which may need to be recycled.

To update and reboot the VM:

$ colima ssh
user@colima:~$ sudo apt update -y && sudo apt upgrade -y
user@colima:~$ reboot

A more brute-force approach is to delete the VM and provision a new one.

colima delete -f
colima start -v --cpu 4 --memory 8

Note the -v switch which will produce additional output that can be helpful.