Switching from Docker Desktop For Mac to Colima

By Eric Haughee

2 min read

Primarily I followed these two guides but there were some missing pieces I had to figure out myself.

Put colima start CLI options in a config file

In the override.yaml file you can put things like cpus: 8, memory: "8GiB", etc so that you can simply run colima start. An example ~/.colima/_lima/_config/override.yaml is below.

vmType: "vz"
cpus: 8
memory: "8GiB"
mounts:
  - location: "/host/filesystem/location1"
    # by default, the mountPoint will be the same as the location, meaing
    # /host/filesystem/location1 will be mounted in the Docker VM as the same path
    writable: true
  - location: "/host/filesystem/location2"
    writable: true

More example configuration and details are in the Lima repository.

Giving Colima access to host filesystem locations

The above config file also points out another missing piece, how to give the Docker VM access to your host filesystem mounts.

You can also do this during colima start by using the --mount /host/location:/docker/vm/location:w where :w makes the directory writeable.

Basically everything on the left side of a services dir:dir entry in your docker-compose.yml's volumes: sections should be mounted for Colima. However, you don't have to mount each individual subdirectory. For instance, you can mount everything in a Nas network folder by just doing /Volumes/YourSharedFolderName and your containers should have access to /Volumes/YourSharedFolderName/SubDir as well.

Start Colima on system boot

If you, like me, want Colima (and your containers) to start on boot, you can easily do so by running brew services start colima