Commit 7cb81a31 authored by Jochen Roth's avatar Jochen Roth Committed by Christian Kuhn
Browse files

[TASK] Version check docker-compose v2

Docker for Mac (and Windows?) currently misuses their
users as canary testers by actively activating an
"experimental" feature toggle which then ships
a docker-compose v2 rc release.

docker-composer v2's yaml parsing however is broken
(you had ONE job!): It does not properly detect strings
as strings and mumbles about this, and worse, it transforms
shell "don't linebreak!" '\' operator into linebreaks. This
breaks our carefully crafted and formatted testing related
docker-compose.yml configuration.

The situation persists for weeks already, there is no
solution except manually disabling this docker for mac
experimental feature toggle.

The patch makes detect docker-composer v2,
exits out with an error message telling the version
is not supported and how to disable it. ddev went with
a similar approach recently.

Resolves: #95057
Releases: master, 10.4, 9.5
Change-Id: Iee1e6fd28d876262f00aba769a7e047c14db903c

Tested-by: core-ci's avatarcore-ci <>
Tested-by: Christian Kuhn's avatarChristian Kuhn <>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <>
parent 1f0ab7fb
......@@ -231,6 +231,16 @@ if ! type "docker-compose" > /dev/null; then
exit 1
# docker-compose v2 is enabled by docker for mac as experimental feature without
# asking the user. v2 is currently broken. Detect the version and error out.
DOCKER_COMPOSE_VERSION=`docker-compose version --short`
DOCKER_COMPOSE_MAJOR=`echo $DOCKER_COMPOSE_VERSION | cut -d'.' -f1 | tr -d 'v'`
if [[ "$DOCKER_COMPOSE_MAJOR" -gt "1" ]]; then
echo "docker-compose $DOCKER_COMPOSE_VERSION is currently broken and not supported by"
echo "If you are running Docker Desktop for MacOS/Windows disable 'Use Docker Compose V2 release candidate' (Settings > Experimental Features)"
exit 1
# Go to the directory this script is located, so everything else is relative
# to this dir, no matter from where this script is called.
THIS_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment