update-alternatives doesn't exist on every distro · Issue #10 · docker/compose-switch · GitHub
Skip to content

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

Open

Description

@ericb-summit

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.

Activity

  1. ndeloof commented on Oct 3, 2021

    @ndeloof
    Contributor

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

  2. ericb-summit commented on Oct 5, 2021

    @ericb-summit
    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?

  3. slonopotamus commented on Oct 5, 2021

    @slonopotamus

    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.

  4. ndeloof commented on Oct 6, 2021

    @ndeloof
    Contributor

    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

  5. Titus-von-Koeller commented on Dec 22, 2021

    @Titus-von-Koeller

    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

  6. slonopotamus commented on Jan 5, 2022

    @slonopotamus

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions