From 0181b80bbe1d8f0c9ca740f0381314b4c8e4dd9e Mon Sep 17 00:00:00 2001 From: BenediktMKuehne Date: Tue, 12 Dec 2023 14:12:43 +0000 Subject: [PATCH] check pip docker version --- installer.sh | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/installer.sh b/installer.sh index 2310b2f6..73fa2c1d 100755 --- a/installer.sh +++ b/installer.sh @@ -205,6 +205,7 @@ reset_docker(){ install_debs(){ local DOCKER_COMP_VER="" + local DOCKER_VER="" echo -e "\n${GREEN}""${BOLD}""Install debian packages for EMBArk installation""${NC}" apt-get update -y # Git @@ -233,26 +234,32 @@ install_debs(){ read -p "Fix docker stuff, then continue. Press any key to continue ..." -n1 -s -r fi if ! command -v docker > /dev/null ; then - apt-get install -y docker.io + apt-get install -y docker.io + fi + DOCKER_VER=$(pip3 show docker | grep Version: | awk '{print $2}') + if [[ $(version "${DOCKER_VER}") -ge $(version "7.0.0") ]]; then + echo -e "\n${ORANGE}WARNING: compatibility of the used docker version is unknown!${NC}" + echo -e "\n${ORANGE}Please consider downgrading your pip3 docker version. \$pip3 install \"docker<7.0.0\"${NC}" + read -p "If you know what you are doing you can press any key to continue ..." -n1 -s -r fi # docker-compose if ! command -v docker-compose > /dev/null ; then - pip3 install docker-compose --upgrade || true - if ! [[ -d /usr/bin/docker-compose ]]; then + pip3 install docker-compose --upgrade || true + if ! [[ -d /usr/bin/docker-compose ]]; then ln -sf /usr/local/bin/docker-compose /usr/bin/docker-compose - fi + fi else - DOCKER_COMP_VER=$(docker-compose -v | grep version | awk '{print $3}' | tr -d ',') - if [[ $(version "${DOCKER_COMP_VER}") -lt $(version "1.28.5") ]]; then + DOCKER_COMP_VER=$(docker-compose -v | grep version | awk '{print $3}' | tr -d ',') + if [[ $(version "${DOCKER_COMP_VER}") -lt $(version "1.28.5") ]]; then echo -e "\n${ORANGE}WARNING: compatibility of the used docker-compose version is unknown!${NC}" echo -e "\n${ORANGE}Please consider updating your docker-compose installation to version 1.28.5 or later.${NC}" read -p "If you know what you are doing you can press any key to continue ..." -n1 -s -r - fi + fi fi # python3-dev if ! dpkg -l python3.10-dev &>/dev/null; then - apt-get install -y python3.10-dev || apt-get install -y -q python3-dev + apt-get install -y python3.10-dev || apt-get install -y -q python3-dev fi # python3-django if ! dpkg -l python3-django &>/dev/null; then