update-alternatives doesn't exist on every distro
I appreciate that this tool exists, but upate-alternatives / alternatives hardly exists everywhere (e.g. coreos, flatcar, etc...). It would be helpful if you could provide quickstart instructions on how to use the tool such a scenario.
This way people won't just version lock themselves to the latest v1 binary when they realize all their automations based on docker-compose are broken.
Sure, then just setup your PATH to pick up compose-switch before legacy docker-compose V1.
Can I call this wrapper simply docker-compose and put it in the path normally? In that case, how would this script find the real compose v2 binary?
This script will just call docker compose. And docker compose is supposed to find Compose V2 because the latter is placed in cli-plugins dir somewhere under /usr, I forgot exact location.
Compose V2 binary 2.0.1 actually includes some of the logic from this repo and can be used directly as docker-compose binary in your path
Compose V2 binary 2.0.1 actually includes some of the logic from this repo and can be used directly as
docker-composebinary in your path
Cool, that really solved it for us. In Alpine, we did the following:
ln -sf /usr/lib/docker/cli-plugins/docker-compose /usr/bin/docker-compose
docker-compose --version # CLI v1 compatibility mode
docker compose version # CLI v2 interface
Thx @ndeloof
Compose V2 binary 2.0.1 actually includes some of the logic from this repo and can be used directly as
docker-composebinary in your path
So... What is the recommended approach?
a. Use Docker Compose V2 as docker-compose
b. Use compose-switch as docker-compose