-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Remove docker compose v1 #2187
Remove docker compose v1 #2187
Conversation
8b1cd42
to
c4d868d
Compare
@@ -8,12 +8,10 @@ fi | |||
|
|||
echo "${_group}Initializing Docker Compose ..." | |||
|
|||
# Some environments still use `docker-compose` even for Docker Compose v2. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this ever true? I think some environments allow docker-compose
to be used even on Docker Compose v2, but the official syntax should be docker compose
instead of docker-compose
. At least specified in the docs:
https://docs.docker.com/compose/migrate/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We found it to be true in the wild, hence the accommodation. Could dig in history and find the PR for more detail. It was a linux distro that munged the name, don't remember which.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See https://docs.docker.com/compose/install/standalone/
For example type
docker-compose up
when using Compose standalone, instead ofdocker compose up
.
@@ -20,14 +20,14 @@ if [[ "$(vergte ${DOCKER_VERSION//v/} $MIN_DOCKER_VERSION)" -eq 1 ]]; then | |||
fi | |||
echo "Found Docker version $DOCKER_VERSION" | |||
|
|||
COMPOSE_VERSION=$($dc_base version --short || echo '') | |||
COMPOSE_VERSION=$(docker compose version --short || echo '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect to see $dc_base
removed on this PR, too, if we're removing references to it.
But why remove references to it? Is it so bad to have that abstracted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$dc_base
is removed, but I can keep it too if it's useful to keep that abstracted. The reason I removed it is because it seemed to only be used to determine if docker compose
or docker-compose
should be used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for removal for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I bet we're going to hear about this from users. 🐭
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
@@ -8,12 +8,10 @@ fi | |||
|
|||
echo "${_group}Initializing Docker Compose ..." | |||
|
|||
# Some environments still use `docker-compose` even for Docker Compose v2. | |||
dc_base="$(docker compose version &>/dev/null && echo 'docker compose' || echo 'docker-compose')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A change in docker compose > 2 which caused some users complaining about it, was that it couldn't run as a standalone binary anymore. And maintainer's response was to make it executable.
So the only docker compose which could not get run as a executable was 2.0.0 and any docker compose >= 2.0.1 can get run as executable.
And some users (not sure how many) still rely on docker-compose and make /usr/bin/docker-compose
or /usr/local/bin/docker-compose
a symlink to /usr/lib/docker/cli-plugins/docker-compose
, so they can just run docker-compose
and not docker compose
.
So some distributions (at least one I know :) ) still create this symlink.
Discussion about this should be done or not, what (docker compose
or docker-compose
) should get used or best practices about this is out of scope of this repository IMHO, but keeping this so users which are still relying on docker-compose
existence and use it instead of docker compose
is not something hard to maintain in future.
So I advise keeping this line and reverting s/$dc_base/docker compose/
below.
P.S. I have switched to docker compose
myself:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair enough, we can keep this around then 👍
docker is removing support for v1 after June 2023, so let's get rid of it in self-hosted
closes #2076