docker-zulip icon indicating copy to clipboard operation
docker-zulip copied to clipboard

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

Open liammulh opened this issue 1 year ago • 3 comments

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 avatar Sep 27 '22 17:09 liammulh

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.

liammulh avatar Sep 27 '22 22:09 liammulh

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 :anger:

mnzaki avatar Oct 21 '22 10:10 mnzaki

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.

klardotsh avatar Dec 28 '22 21:12 klardotsh