Skip to content

Instantly share code, notes, and snippets.

@ncclementi
Created February 20, 2024 16:02
Show Gist options
  • Save ncclementi/e3067e26a63f4a8717338bfe0be3b49d to your computer and use it in GitHub Desktop.
Save ncclementi/e3067e26a63f4a8717338bfe0be3b49d to your computer and use it in GitHub Desktop.

Colima: Run docker in Mac m1/m2 without Docker Desktop

References:

Colima

Colima is container runtimes on macOS (and Linux) with minimal setup, that has M1 macs support.

Get started

  1. Uninstall Docker Desktop

If you have Docker desktop installed, followed the references, both of them have a section on how to get rid of it.

  1. Install Docker Client with brew

Make sure you brew is up to date and cashed cleaned up, just in case.

$ brew install docker

Check installation by doing

$ docker --version
$ docker version

Notice we haven't installed any Docker Engine yet.

  1. Install Colima
$ brew install colima
  1. Install Docker Compose Plugin (optional)

If you want to be able to run docker compose ... follow this steps. Noticed I said docker compose ... not docker-compose ...

According to the official Docker documentation, run the following commands in a separate terminal:

Replace the link on the curl step with the version you desired, find them here https://github.com/docker/compose/releases/

$ DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
$ mkdir -p $DOCKER_CONFIG/cli-plugins
$ curl -SL https://github.com/docker/compose/releases/download/v2.24.6/docker-compose-darwin-aarch64 -o $DOCKER_CONFIG/cli-plugins/docker-compose

Then add execution permission to the downloaded binary:

$ chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose

Check it worked:

$ docker compose version
  1. Take it for a spin. (Example for the Ibis project)
$ colima start

Note: By default this starts with 2cpu and 2GB of memory, and 60GB disk

$ colima status
$ colima list

You can modify this, with --cpu, --memory and --disk.

In the Ibis repo base directory

$ just up postgres

This will trigger a docker compose up. bash

$ pytest ibis/backends/postgres/tests
$ just down postgres
$ colima stop

Then you can start colima again with just colima start. If you upgraded colima, you need to delete the exisiting instance by doing. I also found that if you want to modify the allocation, you need to delete the exisiting instance too (unless you are going only up).

$ colima delete

Extra notes

  • You can provide --arch to colima start to specify an architecture.
  • You can modify the --runtime (by default docker) to be conteinerd.
  • You can enable kubernetes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment