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
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/problem-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ body:
label: Docker Compose Version
placeholder: 2.6.0 ← should look like this (docker compose version)
description: |
What version of docker-compose are you using to run self-hosted?
You need to use docker-compose --version if you are running < v2.0.0.
What version of docker compose are you using to run self-hosted?
validations:
required: true
- type: textarea
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ jobs:
fail-fast: false
matrix:
include:
# Disabled due to https://github.com/getsentry/self-hosted/issues/1415
# - compose_version: "1.28.0"
# compose_path: "/usr/local/bin"
# - compose_version: "1.29.2"
# compose_path: "/usr/local/bin"
chadwhitacre marked this conversation as resolved.
Show resolved Hide resolved
- compose_version: "v2.0.1"
compose_path: "/usr/local/lib/docker/cli-plugins"
- compose_version: "v2.7.0"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Official bootstrap for running your own [Sentry](https://sentry.io/) with [Docke
## Requirements

* Docker 19.03.6+
* Compose 1.28.0+
* Compose 2.0.0+
* 4 CPU Cores
* 8 GB RAM
* 20 GB Free Disk Space
Expand Down
6 changes: 2 additions & 4 deletions install/dc-detect-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.

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 👍

if [[ "$(basename $0)" = "install.sh" ]]; then
dc="$dc_base --ansi never --env-file ${_ENV}"
dc="docker compose --ansi never --env-file ${_ENV}"
else
dc="$dc_base --ansi never"
dc="docker compose --ansi never"
fi
proxy_args="--build-arg http_proxy=${http_proxy:-} --build-arg https_proxy=${https_proxy:-} --build-arg no_proxy=${no_proxy:-}"
dcr="$dc run --rm"
Expand Down