From db24b6a301b2cff8de63f301e82c0f9285b79c4e Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Mon, 27 Aug 2018 11:15:27 +0200 Subject: [PATCH] fix: [docker-host] soften constraint on ``docker-compose`` exact version string We had the build number changing from ``a133471`` to ``unknown``. --- precise/host/hooks/install.d/70-0k.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/precise/host/hooks/install.d/70-0k.sh b/precise/host/hooks/install.d/70-0k.sh index 673adec..530f3c9 100755 --- a/precise/host/hooks/install.d/70-0k.sh +++ b/precise/host/hooks/install.d/70-0k.sh @@ -176,16 +176,17 @@ sysctl -w net.ipv4.ip_forward=1 if type -p docker-compose >/dev/null; then #echo "Found docker-compose..." >&2 - if ! docker-compose --version >/dev/null 2>&1; then + if ! CURRENT_VERSION_TEXT="$(docker-compose --version 2>/dev/null)"; then echo "'docker-compose' failed ! Please check your docker-compose binary." echo "Failed install." docker-compose --version exit 1 fi - VALID_VERSION_TEXT="docker-compose version 1.21.2, build a133471" - if [ "$(docker-compose --version)" != "$VALID_VERSION_TEXT" ]; then + VALID_VERSION_TEXT="docker-compose version 1.21.2, build " + if ! [[ "$CURRENT_VERSION_TEXT" == "$VALID_VERSION_TEXT"* ]]; then echo "Invalid version of docker-compose: we need exactly:" - echo "version text: $VALID_VERSION_TEXT" + echo "version text: $VALID_VERSION_TEXT" + echo "current version: $CURRENT_VERSION_TEXT" echo "Failed install." exit 1 fi