Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update-alternatives doesn't exist on every distro #10

Open
ericb-summit opened this issue Sep 30, 2021 · 6 comments
Open

update-alternatives doesn't exist on every distro #10

ericb-summit opened this issue Sep 30, 2021 · 6 comments

Comments

@ericb-summit
Copy link

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.

@ndeloof
Copy link
Contributor

ndeloof commented Oct 3, 2021

Sure, then just setup your PATH to pick up compose-switch before legacy docker-compose V1.

@ericb-summit
Copy link
Author

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?

@slonopotamus
Copy link

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.

@ndeloof
Copy link
Contributor

ndeloof commented Oct 6, 2021

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

@Titus-von-Koeller
Copy link

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

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

@slonopotamus
Copy link

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

So... What is the recommended approach?

a. Use Docker Compose V2 as docker-compose
b. Use compose-switch as docker-compose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants