Closed yaronkoren closed 10 months ago
Weirdly enough, I just came across a case where docker compose
doesn't exist on a machine but docker-compose
does. I guess it all comes down to how the user installed Docker.
Sigh, this is annoying.
I guess the only thing that can be done is try both docker-compose
and docker compose
...
The error when it doesn't find Docker Compose is:
Docker Compose is not installed; please follow the guide at https://docs.docker.com/compose/install/ to install it.
That link for documentation seems to recommend docker compose version
.
The output for which docker compose
gives both Docker and Compose (looks like some other program):
/usr/bin/docker
/usr/bin/compose
That's too bad... I guess the code should call "which docker-compose", and, if that doesn't return anything, call "docker compose version" - and check the result of that, since that one will presumably always output something.
Since all the Docker documentation recommends docker compose version
, shouldn't that be the better command to start with?
Turns out installing it via sudo apt install docker-compose
did the trick. Using the steps provided in the Canasta documentation (which points you to the Docker documentation) doesn't get you what you need. I think that process gives you docker-compose-plugin instead of docker-compose.
Oh, okay. So, should the "docker compose version" check still be added, or is it just a matter of fixing the documentation?
I think fixing the documentation would close this out.
Hi, "docker-compose" is the old version of "docker compose", so if "docker compose" doesnt exist the only other way to have it working is installing "docker-compose-plugin".
Currently the CLI internally uses docker-compose
to function, therefore to make it work with the newer and recommended docker-compose-plugin we would have to make some changes to the CLI, not just the install.sh
script. It could be implemented if it is a issue for people to deal with.
In a month or so docker-compose will be deprecated.
I want to work on this issue. Can I please have it assigned
@PiyushRaj927 - this is assigned to you!
There are two methods for the existence of the compose in the system:
To make sure that the CLI program works for both methods, it can either check if the compose sub-command is present or the user can specify the location of the compose executable as suggested by @amalpaul54111 . This will also allow the CLI to work with the older version of compose i.e docker-compose
@yaronkoren, can you please let me know if I am missing something so that I can start working on it? Thank you.
That sounds right, yes... ideally there should be two different checks. (Assuming that docker-compose is still even in use.)
Not being able to install using the CLI so this detail has been around for months, I tried it yesterday and the same problem with Docker Compose, I used the easy installation cli of Docker for Debian 11, the command in it is docker compose
and not docker-compose
, I tried using alias and it didn't solve it, I changed the file to remove the verification, but there are other places that would need to change as well.
I think it should be focused on the most common pattern or maybe double check or some other docker command that shows this. When we install Docker, as far as I can remember, Docker Compose comes with it.
Hi @FelipoAntonoff, your concerns have already been addressed in my PR.
In the PR, I have added support for docker compose
as docker-compose
has been deprecated by docker. I believe that once the PR is reviewed and merged, it will fix the CLI installation problem you were facing.
Hi @PiyushRaj927, thanks I'll check it out. I hope you approve soon, it looks like it's a few weeks for review, I'll test the changes later so I can test it.
@yaronkoren said above:
... (Assuming that docker-compose is still even in use.)
docker-compose
is deprecated and should not be supported by Canasta. From the documentation at https://docs.docker.com/compose/migrate/ :
From July 2023 Compose V1 stopped receiving updates. It’s also no longer available in new releases of Docker Desktop.
Compose V2, which was first released in 2020, is included with all currently supported versions of Docker Desktop. It offers an improved CLI experience, improved build performance with BuildKit, and continued new-feature development.
There is an alias installed that will still make the hyphenated docker-compose
command work on recent docker compose installs, but the "is it installed?" check should be for docker compose version
.
The preferred method of installing Docker Compose is either via installing Docker Desktop (in a non-server environment); or installing the Compose "Plugin" to Docker Engine using the official repository https://docs.docker.com/compose/install/linux/#install-using-the-repository
I'm closing this issue as resolved. Canasta now only supports Docker Compose version 2 (the plugin, not the deprecated standalone binary). The installer checks for it, and aborts if docker compose version
fails.
Right now install.sh calls "which docker-compose" to see if Docker Compose is installed. That doesn't always work, though - it seems like, at least in Ubuntu, this call returns nothing, even if Docker Compose is there. Perhaps "docker compose version" is a more reliable call.