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

Remove docker compose v1 #2187

Merged
merged 6 commits into from
Jun 9, 2023
Merged

Conversation

hubertdeng123
Copy link
Member

@hubertdeng123 hubertdeng123 commented Jun 5, 2023

docker is removing support for v1 after June 2023, so let's get rid of it in self-hosted

closes #2076

@hubertdeng123 hubertdeng123 force-pushed the hubertdeng123/remove-compose-v1 branch from 8b1cd42 to c4d868d Compare June 5, 2023 21:51
@@ -8,12 +8,10 @@ fi

echo "${_group}Initializing Docker Compose ..."

# Some environments still use `docker-compose` even for Docker Compose v2.
Copy link
Member Author

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/

Copy link
Member

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.

Copy link

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 of docker 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 '')
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member

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.

Copy link
Member

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. 🐭

Copy link
Member

@BYK BYK left a 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')"
Copy link
Collaborator

@aminvakil aminvakil Jun 7, 2023

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

Copy link
Member Author

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 👍

@hubertdeng123 hubertdeng123 merged commit 5c77236 into master Jun 9, 2023
@hubertdeng123 hubertdeng123 deleted the hubertdeng123/remove-compose-v1 branch June 9, 2023 16:04
@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Drop Support for Docker Compose v1
5 participants