Skip to content

Commit

Permalink
Merge pull request #1248 from m-1-k-3/another_updates
Browse files Browse the repository at this point in the history
docker compose install issue
  • Loading branch information
m-1-k-3 authored Jul 23, 2024
2 parents b28cddd + 531a0ea commit af2e287
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
8 changes: 4 additions & 4 deletions installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -286,17 +286,14 @@ apt-get -y install python3-venv
create_pipenv "./external/emba_venv"
activate_pipenv "./external/emba_venv"

# initial installation of the host environment:
I01_default_apps_host

export DOCKER_COMPOSE=("docker-compose")
# docker moved around v7 to a new API (API v2)
# we need to check if our installed docker version has support for the compose sub-command:
if command -v docker > /dev/null; then
if docker --help | grep -q compose; then
# new docker API version v2 -> docker v7
export DOCKER_COMPOSE=("docker" "compose")
else
elif command -v docker-compose > /dev/null; then
# we only need to check the docker-compose version if we are running on the old API with docker-compose
DOCKER_COMP_VER=$("${DOCKER_COMPOSE[@]}" -v | grep version | tr '-' ' ' | awk '{print $4}' | tr -d ',' | sed 's/^v//')
if [[ $(version "${DOCKER_COMP_VER}") -lt $(version "1.28.5") ]]; then
Expand All @@ -308,6 +305,9 @@ if command -v docker > /dev/null; then
fi
fi

# initial installation of the host environment:
I01_default_apps_host

if [[ "${OTHER_OS}" -eq 1 ]]; then
# UBUNTU
if [[ "${UBUNTU_OS}" -eq 1 ]]; then
Expand Down
9 changes: 8 additions & 1 deletion installer/I01_default_apps_host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ I01_default_apps_host() {
print_tool_info "jq" 1
print_tool_info "shellcheck" 1
print_tool_info "unzip" 1
print_tool_info "docker-compose" 1
print_tool_info "bc" 1
print_tool_info "coreutils" 1
print_tool_info "ncurses-bin" 1
Expand Down Expand Up @@ -52,6 +51,14 @@ I01_default_apps_host() {
echo
apt-get install "${INSTALL_APP_LIST[@]}" -y
pip_install "requests" "-U"

if ! command -v "${DOCKER_COMPOSE[@]}" > /dev/null; then
echo "Installing ${DOCKER_COMPOSE[*]} manually:"
# install docker-compose manually:
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
fi

;;
esac
}
3 changes: 3 additions & 0 deletions installer/helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ print_tool_info(){
INSTALL_APP_LIST+=("${1:-}")
fi
fi
else
echo -e "${RED}""${1:-}"" is not available anymore - installation can't proceed.""${NC}"
exit 1
fi
}

Expand Down

0 comments on commit af2e287

Please sign in to comment.