Skip to content

Commit

Permalink
check pip docker version
Browse files Browse the repository at this point in the history
  • Loading branch information
BenediktMKuehne committed Dec 12, 2023
1 parent 6ddbbaf commit 0181b80
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0181b80

Please sign in to comment.