-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
How to install docker-compose v2 on Linux #8575
Comments
As per https://docs.docker.com/compose/cli-command/#install-on-linux
Note: The version number may change, obviously! |
Hmm, after taking those actions on Ubuntu 20.04 I see: docker-compose --version
docker-compose version 1.28.5, build c4eb3a1f I do see that Also, would be good to maintain the INSTALL.md |
Yes, that's a separate tool and can co-exist (for now). |
The question here is "How to install docker-compose v2 on Linux" Hundreds or thousands of tools wrap docker-compose. An installation technique to make compose-cli be "docker-compose" is essential for those tools. |
Let me copy my comment from docker/docker-ce-packaging#553 (comment)
If you take the source ~/.bashrc source ~/.zshrc |
So there are a number of problems with this approach.
I really recommend a more robust wrapper that will let tools in the Linux world move forward. All it takes is a simple script or binary that replaces the original docker-compose. |
A separate "compatibility package" could be possible, but if docker-compose v1 is not deprecated, it should not come by default. For Docker Desktop, the installation is somewhat more "opinionated", but for a Linux server install, things are more involved. Docker itself has not shipped Adding the wrapper to the default package means we will have to add a Things become more involved if the user has So yes, possibly a "compatibility" package could be created (although it would be just a script doing the same as an alias). That package would be an optional install (user to opt-in), and that package could So even with the above, I don't think we can resolve the "It requires changing the full environment of an unknown user." situation. It will be difficult / impossible to make any assumptions about a user's configuration. |
What I'm saying is you can't use shell workarounds to solve this problem. You have to use a binary wrapper or something. Shell workarounds are fine for individual users trying to solve particular problems, but they don't solve a migration problem for an important tool that is deployed in thousands of different contexts. |
I don't see why a shell script wouldn't work $ cat /usr/bin/wait
#!/bin/sh
builtin wait "$@"
$ cat /usr/bin/gunzip | grep exec
exec gzip -d "$@" |
Of course I'm talking about a docker-compose equivalent distributed in a standard way by the Docker organization. |
Compose v2 is a CLI plugin, just download it from the release page under see https://github.com/docker/compose-cli#compose-v2-aka-local-docker-compose for more details. We plan to move compose v2 into a separate repository ASAP to avoid confusion with this installation process |
@mat007 makes sense. Unfortunately this codebase has been designed to support canary testing, but we could extract the core redirection logic into a public component as part of compose.v2 codebase |
The shortest-term view is I'd like to be able to run all ddev tests against compose v2 on Linux... because github actions is there and free. That's just to see if we can finally get compose v2 compatible and not have to embargo it. But the long term view is... surely you don't want Linux users of docker-compose to stay on v1 because you've never provided a migration path? It seems like docker-compose on linux deserves first-class status. And yes, I know that supposedly everybody can just start using |
the point is that we can't bundle |
I think it'd be ok to publish a package (before GA); docker/docker-ce-packaging#553 implements it as a separate package (so users will be able to "opt-in" by installing the package). For the transition |
We have published https://github.com/docker/compose-switch |
Good morning my friends I am running the process to use the updated version of docker-compose but the error is returned
Thank you in advance to everyone who can contribute. |
@mozgbrasil try |
It worked as follows Install latest docker-compose
|
The installation for Docker Compose was pretty confusing. I'm trying to follow along via https://docs.docker.com/compose/install/ and / or I believe I should be using the command line instruction version, correct? (insert about an hour of different trials here...) The answer is to follow the cli-commands version. Note: between the different instruction links above, I did a test on Again, for anybody else who gets here, I was totally able to get a successful build using the Command Line Instructions from https://docs.docker.com/compose/cli-command/#install-on-linux Docker version 20.10.11, build dea9396, Linux Ubuntu 20.04.3 LTS |
Is there any rough timeline for when Compose v2 will be G.A? It would simplify deployments if Compose was bundled into the |
Is there any reason Compose v2 cannot be published as a plugin? It would be great to be able to just write |
Would it be possible to install docker compose v2 plugin globally instead of per user (as the docs describe)? |
yes, you can install under any of the default system plugin dirs: |
I made and plan to maintain a gist for an unattended Docker Compose v2 install on Debian based distros under https://gist.github.com/tobiasmuehl/4de1f1c294f96441bec63c5bb0a97b21 |
3 days ago this was merged, which likely is of interest to this thread: |
I see that now both Ubuntu and CentOS have
Curious if Compose V2 is at or near GA now? Should/will the docs be updated to make these the official way to install Compose V2 on Linux? |
Also, related: |
docs will be updated soon then G.A can be announced |
Can you please confirm why the latest versions (it only contains docker-compose-plugin_2.3.3~ubuntu-focal_amd64.deb) of compose are not in https://download.docker.com/linux/ubuntu/dists/focal/pool/stable/amd64/? If compose is not yet G.A., can the GitHub releases be marked as pre-release? |
those are not pre-releases, just we didn't claimed compose v2 to be G.A. before we got it fully integrated in the distribution pipeline (which took much time than expected). Many users relied on github release for manual installation on Linux. |
From a github release viewpoint, not making one as pre-release means it's a final release (which for me, it's the same as GA). IOW, my definition is different than yours, and I don't known what you mean by GA. Can you please point me to the documentation that explains its meaning in this project context? |
I don't think we have a documented definition. |
This thread mentions that GA should be within a month: |
A big issue with an alias approach is that the interface of the api has changed a lot. For example This is perhaps not a problem it's a new API we would expect breaking changes, but interestingly on mac this does not seem to be the case. Mac user can run docker-compose --version and other v1 style docker-compose commands but they seem to translate to a correct v2 command. In a company with a mix of mac and linux being used this is going to get old and confusing quite fast. Is there a more powerful shim available for linux that does something similar to what is being done on mac through docker-desktop? |
@chriswininger don't use an alias, just invoke cli plugin binary as |
Docker Compose V2 was announced as GA: |
I believe this issue is now addressed in the docs: https://docs.docker.com/compose/install/ |
We're still have a glitch in the linux install documentation ATM, I'll close this issue when everything will be ok |
Official doc is fixed now, we can close this issue |
I just don't understand why it cannot be simply bundled into main |
@RafalSkolasinski some people want only the Docker CLI, some others want only Compose, some want the both, that's why each component is shipped separately 🤷♂️ |
since it appears that the maintainers want to make this as painful a process as possible I will just leave this here in a vain attempt that people will find it instead of the innumerable number of broken and unmaintainable ways to get docker compose to work consistently
If you want docker-compose to still work you can then link it with
|
@glours if the convenience script can be used to install both docker and docker compose at once then someone should document that and how to use the script to do that, cause it does not install the docker compose plugin by default. And if you want people to use the convenience script you may want to consider not burying it at the bottom of the page three links into the install documentation. Put it at near the top of the https://docs.docker.com/engine/install/ page and then provide links to how to do the manual install per distro from there. Imagine you are a new user and want to install docker on a new machine, your install page should provide links to the Mac/Windows installers and then instructions to run the convenience script on supported distros followed by links to the distro specific manual installs. not to mention the convenience script link on https://docs.docker.com/compose/install/ which links to the docker engine install page where there is NO MENTION OF THE CONVENIENCE SCRIPT AT ALL! Please feel free to take the above script I provided and integrate it into the docs and your convenience script if needed. Provide it to the user as the default method to install and then as a secondary section show installing a specific version if needed. And when you do that provide a link to a list of version numbers that are available, preferably with changelogs so that users can determine what version they need should they require locking their install to a specific version. The other issue your org has created is that the above way of providing the plugin (and its completely unclear if the convenience script does anything different cause its not documented) is that its outside the standard package management workflow for distros. In the past the manual steps, at least for ubuntu, would set things up in a fashion that meant you got docker updates when you ran your normal apt package upgrade commands. doing things in this half way fashion and not clearly stating how to update and maintain your software means that you end up with differing versions of docker and docker compose across machines if your not careful. I'm sorry that some of my comments come across as aggressive, but the documentation for docker has been getting more and more frustrating over the past few years. There is zero mention in anywhere that I have found about the change from docker-compose to docker compose which should probably be something you want to put right up front so returning users can know and understand the change! And while I'm on my soapbox, please for the love of all that's : call a major version rev of the docker compose file syntax and make the standard syntax have complete feature parity with the docker command line, and then add any other docker swarm stuff as options under the deploy section syntax. Removing cpu, memory and other command line features from version 3 and trying to play this game where version 2 and 3 exist for different reasons while you only push version 3 forward is not fooling anyone. |
Description
I'm trying to allow DDEV to use docker-compose v2 and don't have the resources for a whole set of tests on every macOS variant... but I thought it would be nice to run all the tests using docker-compose v2 on Linux (where it hasn't been introduced yet to my knowledge?)
I followed the linux instructions in https://github.com/docker/compose-cli/blob/main/INSTALL.md but that doesn't do anything I can detect (
curl -L https://raw.githubusercontent.com/docker/compose-cli/main/scripts/install/install_linux.sh | sh
) (and doesn't enable thedocker compose
command either).How can I use docker-compose v2 on Linux?
The text was updated successfully, but these errors were encountered: