Docker Compose v2 now in cimg/base

For the December 2021 monthly snapshot, Docker Compose has been updated in the image from v1 to v2. For more info on v2, please take a look at the Docker Compose Docs.

The immediate thing to note here is that docker-compose as a command has been replaced with docker compose. You can install an older version of Docker Compose if needed with the Docker Orb.

The tags where this change tags place is cimg/base… :2021.12 and of course :stable and :edge.

Update:

With the January snapshot, we have installed Docker Compose Switch. This is an official wrapper for Docker Compose v2 that allows the previous binary name to work but more importantly, makes other mutations from v1 style commands to v2 style commands. Please see the link for more information on how it works.

Please note, at the end of the day, Docker Compose v2 is pre-installed.

2 Likes

This morning all of our tests started failing with docker-compose command does not exist. Our config.yml file specifies to use stable. It was surprising because stable still points to 2021.11 and tests pass if 2021.11 is specified in config.yml.

I wonder if there is a better way to roll out breaking changes like this? Such as: stable only gets updated when the base (eg 2021.11) is updated?

The documentation on cimg/base - CircleCI also doesn’t mention any updates to 2021.11 and lists stable as an alias of 2021.11 although there are at least some differences between them.

Thank you for posting the change here! Otherwise, we probably would have spent a lot more time trying to figure out what happened.

2 Likes

Stable gets updated every month. That’s its intended usage. Using a specific monthly tag is what you want if you don’t want changes to creep in. Not that you’re asking, but for anyone here, edge gets updated with every merged PR to cimg/base so it gets updated the most.


Update:

Docker Compose Switch is now pre-installed with the January update. Please see my original post above.

1 Like

Stable gets updated every month. That’s its intended usage. Using a specific monthly tag is what you want if you don’t want changes to creep in. Not that you’re asking, but for anyone here, edge gets updated with every merged PR to cimg/base so it gets updated the most.

Good to know. Thank you for the clarification!

1 Like

When will docker-compose v2 and/or the “docker compose” syntax be available in the machine images? Specifically, I’m looking to use the docker-compose config --format json / docker compose config --format json syntax.

All recent Ubuntu and Android VM images should have it. Meaning definitely the Q2 release (April) and I think the Q1 (January) release might also have it.