How to install and use docker compose along with colima on MacOS

Docker desktop alternative on MacOS - Colima

Since Docker Desktop for Mac requires a paid subscription for large companies, a promising alternative is Colima. Colima provides a lightweight, open-source solution for running containers on macOS, making it an excellent choice for developers looking to avoid licensing fees. It supports both Intel and Apple Silicon processors.

If you use homebrew, the installation is simple:

brew install colima

To start colima:

colima start

Install docker and docker-compose

Docker Compose is a popular and convenient tool for managing multi-container applications, allowing you to define and run all your project dependencies together. Since Colima is a lightweight runtime and does not include Docker Compose by default, you need to install it separately along with Docker:

brew install docker docker-compose

Configure docker-compose as a plugin

To use docker compose as a command instead of the legacy docker-compose script:

  • Create a folder for docker plugins
    mkdir -p ~/.docker/cli-plugins
    
  • Then symlink the docker-compose command into the plugins folder
    ln -sfn $(brew --prefix)/opt/docker-compose/bin/docker-compose ~/.docker/cli-plugins/docker-compose
    
  • And run docker compose
    docker compose version
    
  • Ensure the output looks similar to this: Docker Compose version 2.37.1

Now you are good to go and use docker compose with colima.




Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • Outcome vs Output