Conflicts when trying to install `docker-compose` having `podman` and `podman-docker` already installed

The command is no longer docker-compose it’s now an option to Docker and Podman podman compose or docker compose

I know and I tried to make it clear in my previous posts in this thread but it doesn’t change the fact that it looks like suddenly it’s not possible to install all three packages (podman, podman-docker and docker-compose) together to have docker command implemented by Podman and at the same time to have docker compose use the original Docker implementation of compose. This was possible in Fedora 40 and this is what I’m looking for in Fedora 41. What’s more I think many people will be looking for exactly the same combination of packages as Podman’s implementation of docker is fairly complete allowing to use it instead of Docker’s implementation of docker whereas Podman’s implementation of compose still lacks many features of Docker’s implementation of compose (for example I stumbled on this issue docker compose config – --profiles option not supported · Issue #1052 · containers/podman-compose · GitHub).

2 Likes

Thank You very much!

In the issue you state

Older versions of docker-compose in Fedora allowed podman-docker as an alternative.

Out of curosity and treating this as a chance to learn something, could you please point out where specifically does docker-compose package in Fedora 40 allow this?

Btw, I guess there are some automated tests for Fedora. If so would it be possible to add test checking that all three packages can be installed together to avoid this in the future or am I asking for too much?

Thinking out loud; I find it strange that this problem hasn’t been found earlier taking into consideration these are rather popular admin and developer tools and Fedora 41 brewing for a few months now…

I’m one such user. I use the same combination of packages to host the community edition of overleaf on a local server. I’m not brave enough to try to upgrade my server to a beta release though. Thank you for testing and reporting this bug so I won’t have to deal with it when I upgrade to Fedora Linux 41!

1 Like

In Fedora F40 and older, docker-compose is version 1 which is a stand-alone application written in python. I have not looked at the source code, but the Fedora spec file used to create the rpm does not have any explicit dependency on docker (i.e. a Requires or BuildRequires), only on python-docker which is the python sdk for docker engine API.

In Fedora 41 and newer, docker-compose is the v2 version which is executed as a plugin to docker. The new application docker-compose-switch provides a binary called docker-compose which translates the command line call to docker-compose into the relevant docker compose command.

I was, perhaps naively, assuming that the Requires docker-cli line in the docker-compose (v2) spec file could be modified to Requires (docker-cli or podman-docker) and it would “just work”. Sadly that is not the case. I ran into bugs. Working on it.

2 Likes

Some testing results.

With F41, installing docker-compose and docker-cli rpms currently in the repository results in a system where docker-compose works as expected. The current repository version of docker-compose also installs as a requirement docker-compose-switch which is the rpm that installs that actual docker-compose binary on the system path. The docker-compose rpm on installs the plug-in binary which docker uses to enable docker compose features. This is one way to retain current docker-compose functionality.

I created a revised docker-compose rpm locally that allows either docker-cli or podman-docker to provide the docker binary. This revised rpm also makes docker-compose-switch optional and no longer required.

With docker-compose and either podman-docker or docker it appears that docker compose or podman compose work fine.

If docker-compose-switch is installed with podman-docker then an infinite loop is created when the docker-compose or docker compose commands are used. I believe that this is because podman is calling the docker-compose plugin but somehow the call lands on the docker-compose binary which calls docker (ie podman) which calls docker-compose establishing a loop. At least that is my guess.

The upshot is that in the near term in F41 using docker-compose at the command-line is only possible with the Docker stack, ie docker-compose, docker-compose-switch and docker-cli.

docker compose where the compose feature is a plug-in to docker is where the Docker community intends users to go with docker-compose available as a convenience for current users. Under the hood, this “new” docker-compose makes calls to docker compose to actually implement the commands.

With the revised docker-compose rpm podman-docker can be used as long as docker-compose-switch is not installed but only provides the docker compose or podman compose commands.

I think I need to reach out to the podman community to see if ‘docker-compose-switch’ can be integrated successfully.

If the podman ecosystem is desired then a possible option is podman-compose. Install podman and podman-compose which will provide much the same functionality using podman-compose or podman compose at the command line. I suppose a simple alias in bash (or fish or zsh) of docker-compose to podman-compose would offer a seamless switch while retaining the docker-compose command itself.

@gotmax23 @sergiomb - Any thoughts? PR submitted for consideration.

1 Like

As an additional note - the compose file format is useful for those with both docker and podman in their network ecosystem. I, for example, use docker-compose to manage containers on a Synology NAS.

If you only use podman (especially on Fedora) then it might be beneficial to try podman quadlets which leverages tight integration between podman and systemd. One useful overview of quadlets is: https://blog.while-true-do.io/podman-quadlets/.

1 Like

As a status update, there is a pull request with the docker-compose package to remove the explicit requirement that installs docker-cli and allow podman and, optionally, podman-docker to be installed. Due to a bug in podman, you cannot use docker-compose-switch with podman. So if you want to use “docker-compose” with podman you will need to use either the podman compose or docker compose (with podman-docker installed) commands and not docker-compose`. This pull request will be submitted in the next day or so. It typically takes a week in testing before an update gets to the production repositories.

@gotmax23 also submitted a pull request with the podman team that fixed the docker-compose related bug. When that update is pushed out then you will be able to use docker-compose command with a podman based back end. The pull request is approved but I am not sure when an update will come out.

3 Likes

Today running sudo dnf5 update -y installed new docker-compose:

 docker-compose                                              x86_64     2.29.7-3.fc41                                                 updates-testing                                     58.9 MiB
   replacing docker-compose                                  x86_64     2.29.7-1.fc41                                                 <unknown>                                           58.9 MiB

without conflicts which means the problem was fixed.
Once again big thanks @buckaroogeek for your help and for fixing this.

1 Like

Please let us know if you see any problems. Credit goes to @gotmax23 for the patches to a library used by podman which implemented the fix.