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

In README, should docker-compose be docker compose (no hyphen)? #365

Open
liammulh opened this issue Sep 27, 2022 · 4 comments
Open

In README, should docker-compose be docker compose (no hyphen)? #365

liammulh opened this issue Sep 27, 2022 · 4 comments

Comments

@liammulh
Copy link

If you look at the docs for installing Compose on Linux, you see:

docker-compose

So perhaps the CLI changed from docker-compose to docker compose recently?

I just installed Compose:

docker compose version
Docker Compose version v2.10.2

However, in the README, we are instructed to use docker-compose.

Am I doing something wrong or does the README need to be updated to reflect the new CLI? Thanks!

@liammulh
Copy link
Author

According to docs, Compose V2 uses docker compose "continuing to support most of the previous docker-compose features and flags."

See https://docs.docker.com/compose/#compose-v2-and-the-new-docker-compose-command.

@mnzaki
Copy link

mnzaki commented Oct 21, 2022

This change to docker compose is kinda "fresh" and some systems still support docker-compose which I think they should keep doing for a long time to come, as a lot of automation (i.e. bash scripts) depends on that command existing.

Like my 10 year old <30 lines push-to-deploy script which magically broke a year or two ago 💢

@klardotsh
Copy link
Member

klardotsh commented Dec 28, 2022

At least on Void Linux, docker-compose is now a symlink to directly call the CLI plugin called compose:

(woods) ~  » ls -l /bin/docker*
-rwxr-xr-x 1 root root  39M Dec 21 07:24 /bin/docker*
lrwxrwxrwx 1 root root   46 Nov 22 13:34 /bin/docker-compose -> /usr/libexec/docker/cli-plugins/docker-compose*
lrwxrwxrwx 1 root root   11 May  3  2021 /bin/docker-init -> tini-static*
-rwxr-xr-x 1 root root 1.7M Nov 24 12:18 /bin/docker-proxy*
-rwxr-xr-x 1 root root  69M Nov 24 12:18 /bin/dockerd*

It seems upstream encourages such aliases, though a GitHub-wide search for "docker-compose alias" indicates not all installations include such a thing, particularly CI setups. Notably:

On April 26, 2022, we announced the GA of Docker Compose V2. We want you to have ample time to transition to Compose V2. We won’t sunset Docker Compose V1 immediately, and developers can still revert to V1. Given the numerous successful transitions to Compose V2 so far, we’ve created the following proposed timeline for Docker Compose V1's end of life (EOL):

October 2022 - 6 Months Post GA

  • Support of critical bug fixes and severe security issues will end on Compose v1
  • Users can alias docker-compose to docker compose
  • Users can opt-out of V2 via the Docker Desktop UI or through the docker-compose disable-v2 command

April 2023 - 1 Year Post GA

  • Users can alias docker-compose to docker compose
  • Users can no longer opt-out of V2 via the Docker Desktop UI or through the docker-compose disable-v2 command in new versions

Note: We have no plans of removing any aliasing of docker-compose to docker compose, we want to make it as easy as possible to switch and not break any of your code.

It seems the "correct" thing to do here is to test and validate that we don't use or need to use any of the unimplemented, removed, deprecated, etc. features of the new CLI, and then update the README and any other instructions and/or scripts to use the new V2 CLI.

@timabbott
Copy link
Member

While docker-compose sounds safer because of backwards-compatibility, I think probably it's been long enough post that transition that we can update the docs to use the newer docker compose command name. I'd take a PR from anyone who's tested that the updated commands all run properly.

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

No branches or pull requests

4 participants