How to install docker-compose v2 in Mac Ventura?

I have the below docker desktop installed in Mac Ventura 13.0.1 (M1 Pro chip).

  • Version 4.5.0
  • Engine 20.10.12
  • Compose 1.29.2
  • Kubernetes 1.22.5

Can someone let me know how can I upgrade compose to version 2.26.0?

First you need to invent a time machine :slight_smile: The latest version is 2.14.2.

You can download the version for the ARM based CPU (aarch64) on macOS (darwin). Note that if you just download it from the browser, macOS will not let you run it, because it will remember that the file was downloaded using the browser (or maybe because I used Google Chrome, I am not sure) and macOS could not check the author of the binary. So I downloaded from command line using curl.

https://github.com/docker/compose/releases/download/v2.14.2/docker-compose-darwin-aarch64

Since (in the previous topic) you used docker-compose instead of docker compose, you need to know that Docker Compose v2 is a plugin of Docker and plugins can be installed to multiple locations. When you run docker-compose you will run /usr/local/bin/docker-compose but your plugins can be in your home as well:

$HOME/.docker/cli-plugins/docker-compose

So when you run docker compose where compose is an argument of docker, docker will execute the plugin in th cli-plugins folder if docker-compose is there.

Since Docker Desktop has Docker Compsoe 2.13.0 at the moment which is good enough for you to fix the issue discussed in the other topic, I would not upgrade it at all, unless you need a feature in the latest version. If you still want to upgarde, you could just install the plugin and leave /usr/local/bin/docker-compose untouched.

update

Okay, I was confused because you mentioned a newer version number in the other topic used on AWS and here you mentioned 1.29 on macOS. macOS has Docker Compose v2 and you can optionally allow Docker Desktop to change docker-compose to point to Docker Compose v2. So the process I shared is still the way to download a specific compose version, but you donā€™t need that on macOS. Just use the docker compose command instead of `docker-compose``

1 Like

:smiley: . I meant 2.6.0 to verify the issue in local as suggested in another thread. It is not needed now as you have already confirmed that the issue is fixed in 2.13.0. Thanks for all the help.