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

Use docker-compose if version is gte docker compose #3595

Merged
merged 10 commits into from
Mar 3, 2025
8 changes: 8 additions & 0 deletions install/check-minimum-requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ if [[ -z "$COMPOSE_VERSION" ]]; then
exit 1
fi

STANDALONE_COMPOSE_VERSION=$($dc_base_standalone version --short &>/dev/null || echo '')
if [[ ! -z "${STANDALONE_COMPOSE_VERSION}" ]]; then
if [[ "$(vergte ${COMPOSE_VERSION//v/} ${STANDALONE_COMPOSE_VERSION//v/})" -eq 1 ]]; then
COMPOSE_VERSION="${STANDALONE_COMPOSE_VERSION}"
dc_base='docker-compose'
fi
fi

if [[ "$(vergte ${COMPOSE_VERSION//v/} $MIN_COMPOSE_VERSION)" -eq 1 ]]; then
echo "FAIL: Expected minimum $dc_base version to be $MIN_COMPOSE_VERSION but found $COMPOSE_VERSION"
exit 1
Expand Down
1 change: 1 addition & 0 deletions install/dc-detect-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ echo "${_group}Initializing Docker Compose ..."

# To support users that are symlinking to docker-compose
dc_base="$(docker compose version &>/dev/null && echo 'docker compose' || echo 'docker-compose')"
dc_base_standalone="$(docker-compose version &>/dev/null && echo 'docker-compose' || echo '')"
if [[ "$(basename $0)" = "install.sh" ]]; then
dc="$dc_base --ansi never --env-file ${_ENV}"
else
Expand Down
Loading