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

compose-switch is installed as a Linux "alternative" to docker-compose #4

Merged
merged 1 commit into from
Sep 15, 2021

Conversation

ndeloof
Copy link
Contributor

@ndeloof ndeloof commented Sep 14, 2021

This PR:

  • change installation process so we rely on Linux "alternatives" to replace docker-compose (v1)
  • Drop "enabled|disable-v2" features from compose-switch as user can select implementation by alternatives
  • include Dockerfile for ubuntu and centos to demonstrate installation process works as expected (TODO: automate testing)
  • drop building Windows and OSX binaries (Docker Desktop uses its own flavor of the switch)
  • drop e2e test used to validate enable/disable v2 had the expected effect

see docker/docker-ce-packaging#553 (comment) for context
and https://docker.atlassian.net/browse/IL-584 (internal issue tracker)

README.md Outdated Show resolved Hide resolved
```
1. rename docker-compose if you already have it installed as `/usr/local/bin/docker-compose`
```console
$ mv /usr/local/bin/docker-compose /usr/local/bin/docker-compose-v1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible not to rename it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to define alternative docker-compose command that will come first in PATH, and unfortunately /usr/local/bin comes first (we should not use /usr/local/sbin`)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha, this is not the one from the package, but one that could have been installed by the user

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@mat007 mat007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add an example of how to switch in the readme?

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
centos-test.Dockerfile Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@ndeloof ndeloof force-pushed the alternatives branch 5 times, most recently from 5282363 to 6b45e1d Compare September 14, 2021 10:45
Copy link

@fredericdalleau fredericdalleau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ndeloof ndeloof force-pushed the alternatives branch 3 times, most recently from f2063ab to 5aff87e Compare September 14, 2021 12:26
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Copy link
Contributor

@ulyssessouza ulyssessouza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ndeloof ndeloof merged commit 8a341eb into docker:master Sep 15, 2021
@ndeloof ndeloof deleted the alternatives branch September 15, 2021 08:08
@slonopotamus
Copy link

But how now user switches between V1/V2 on Windows?

@slonopotamus
Copy link

It also doesn't work on every Linux distro, see #10.

@ndeloof
Copy link
Contributor Author

ndeloof commented Oct 3, 2021

But how now user switches between V1/V2 on Windows?

Docker Desktop includes its own flavor of the Compose switch, so you can configure V1 vs V2 on settings. Otherwise, you can just select if docker-compose V1 is first in your PATH.

@slonopotamus
Copy link

Well, I thought the whole point why this project exists was to provide a way to switch between V1 and V2 (it even has switch in its name!). But switch that can no longer switch is kinda... not a switch at all anymore?

@ndeloof
Copy link
Contributor Author

ndeloof commented Oct 3, 2021

the name might be confusing, but the goal of this project is to make it easy to "switch from V1 to V2" by translating docker-compose V1 command into V2. This never has been intended to offer a "switch" to select V1 or V2 depending on your daily mood.

Suggestion to rely on for Linux alternatives was introduced late by a discussion with teammates on Linux packaging, this is not the core of this project.

Maybe we should rename as compose-transition or anything less confusing...

@ericb-summit
Copy link

you can safely assume docker-compose v1 won't get any further updates, so some translation tool like this is much better lesser evil than keeping old unsupported binaries lying around

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

Successfully merging this pull request may close these issues.

7 participants