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

config: prefer compose CLI plugin over docker-compose binary #2194

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

gotmax23
Copy link
Contributor

@gotmax23 gotmax23 commented Oct 6, 2024

Now that Fedora has packaged docker-compose v2, /usr/bin/docker-compose is provided by the docker-compose-switch project which is a shim that translates docker-compose ... into docker compose ... while translating any deprecated CLI arguments into the new compose v2 counterparts.

This has been a problem for podman users that have podman-docker installed, because podman compose tries to call the docker-compose-switch shim and the shim assumes that docker compose will be provided by the actual docker command that calls the appropriate CLI plugin, not a podman wrapper that tries to call the docker-compose shim again, resulting in an endless loop.

Changing podman compose to prefer calling the docker-compose CLI plugin directly should fix this issue.

Ref: https://discussion.fedoraproject.org/t/conflicts-when-trying-to-install-docker-compose-having-podman-and-podman-docker-already-installed/132760/
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=2316333
Ref: https://src.fedoraproject.org/rpms/docker-compose/pull-request/11

Now that Fedora has packaged docker-compose v2, /usr/bin/docker-compose
is provided by the docker-compose-switch project which is a shim that
translates `docker-compose ...` into `docker compose ...` while
translating any deprecated CLI arguments into the new compose v2
counterparts.

This has been a problem for podman users that have podman-docker
installed, because `podman compose` tries to call the
docker-compose-switch shim and the shim assumes that `docker compose`
will be provided by the actual docker command that calls the appropriate
CLI plugin, not a podman wrapper that tries to call the docker-compose
shim again, resulting in an endless loop.

Changing `podman compose` to prefer calling the docker-compose CLI
plugin directly should fix this issue.

Ref: https://discussion.fedoraproject.org/t/conflicts-when-trying-to-install-docker-compose-having-podman-and-podman-docker-already-installed/132760/
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=2316333
Signed-off-by: Maxwell G <[email protected]>
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

This has a small chance to break existing users when they have two different versions installed in $PATH and the cli-plugins dir but I guess that is a risk worth taking considering the real issue you point out.

LGTM

@rhatdan
Copy link
Member

rhatdan commented Oct 7, 2024

/approve
/lgtm
Thanks @gotmax23

Copy link
Contributor

openshift-ci bot commented Oct 7, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gotmax23, rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Oct 7, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit acfcaab into containers:main Oct 7, 2024
16 checks passed
@gotmax23
Copy link
Contributor Author

gotmax23 commented Oct 7, 2024

Thanks! It would to get this released into podman prior to the Fedora 41 Final Freeze on 2024-10-15.

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

Successfully merging this pull request may close these issues.

3 participants