1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2024-12-25 02:29:32 +02:00

Fix Docker Compose recognition for docker-compose syntax

This commit is contained in:
DerLinkman 2022-06-07 18:34:41 +02:00
parent fd853cfc6f
commit 141b397c82
4 changed files with 12 additions and 0 deletions

View File

@ -32,6 +32,9 @@ done
echo "checking docker compose version..."; echo "checking docker compose version...";
if docker compose >/dev/null 2>&1; then if docker compose >/dev/null 2>&1; then
echo -e "\e[32mFound Compose v2!\e[0m" echo -e "\e[32mFound Compose v2!\e[0m"
elif docker-compose version --short | grep -m1 "^2" > /dev/null 2>&1; then
echo -e "\e[32mFound Compose v2!\e[0m"
COMPOSE_COMMAND="docker compose"
elif docker-compose version --short | grep -m1 "^1" > /dev/null 2>&1; then elif docker-compose version --short | grep -m1 "^1" > /dev/null 2>&1; then
echo -e "\e[33mWARN: Your machine is using Docker-Compose v1!\e[0m" echo -e "\e[33mWARN: Your machine is using Docker-Compose v1!\e[0m"
echo -e "\e[33mmailcow will drop the Docker-Compose v1 Support in December 2022\e[0m" echo -e "\e[33mmailcow will drop the Docker-Compose v1 Support in December 2022\e[0m"

View File

@ -88,6 +88,9 @@ function preflight_local_checks() {
echo "checking docker compose version..."; echo "checking docker compose version...";
if docker compose >/dev/null 2>&1; then if docker compose >/dev/null 2>&1; then
echo -e "\e[32mFound Compose v2 on local machine!\e[0m" echo -e "\e[32mFound Compose v2 on local machine!\e[0m"
elif docker-compose version --short | grep -m1 "^2" > /dev/null 2>&1; then
echo -e "\e[32mFound Compose v2!\e[0m"
COMPOSE_COMMAND="docker compose"
elif docker-compose version --short | grep -m1 "^1" > /dev/null 2>&1; then elif docker-compose version --short | grep -m1 "^1" > /dev/null 2>&1; then
echo -e "\e[33mWARN: Your machine is using Docker-Compose v1!\e[0m" echo -e "\e[33mWARN: Your machine is using Docker-Compose v1!\e[0m"
echo -e "\e[33mmailcow will drop the Docker-Compose v1 Support in December 2022\e[0m" echo -e "\e[33mmailcow will drop the Docker-Compose v1 Support in December 2022\e[0m"

View File

@ -80,6 +80,9 @@ echo "checking docker compose version...";
if docker compose >/dev/null 2>&1; then if docker compose >/dev/null 2>&1; then
echo -e "\e[32mFound Compose v2!\e[0m" echo -e "\e[32mFound Compose v2!\e[0m"
COMPOSE_COMMAND="docker compose" COMPOSE_COMMAND="docker compose"
elif docker-compose version --short | grep -m1 "^2" > /dev/null 2>&1; then
echo -e "\e[32mFound Compose v2!\e[0m"
COMPOSE_COMMAND="docker compose"
elif docker-compose version --short | grep -m1 "^1" > /dev/null 2>&1; then elif docker-compose version --short | grep -m1 "^1" > /dev/null 2>&1; then
echo -e "\e[33mWARN: Your machine is using Docker-Compose v1!\e[0m" echo -e "\e[33mWARN: Your machine is using Docker-Compose v1!\e[0m"
echo -e "\e[33mmailcow will drop the Docker-Compose v1 Support in December 2022\e[0m" echo -e "\e[33mmailcow will drop the Docker-Compose v1 Support in December 2022\e[0m"

View File

@ -49,6 +49,9 @@ echo "checking docker compose version...";
if docker compose >/dev/null 2>&1; then if docker compose >/dev/null 2>&1; then
echo -e "\e[32mFound Compose v2!\e[0m" echo -e "\e[32mFound Compose v2!\e[0m"
COMPOSE_COMMAND="docker compose" COMPOSE_COMMAND="docker compose"
elif docker-compose version --short | grep -m1 "^2" > /dev/null 2>&1; then
echo -e "\e[32mFound Compose v2!\e[0m"
COMPOSE_COMMAND="docker compose"
elif docker-compose version --short | grep -m1 "^1" > /dev/null 2>&1; then elif docker-compose version --short | grep -m1 "^1" > /dev/null 2>&1; then
echo -e "\e[33mWARN: Your machine is using Docker-Compose v1!\e[0m" echo -e "\e[33mWARN: Your machine is using Docker-Compose v1!\e[0m"
echo -e "\e[33mmailcow will drop the Docker-Compose v1 Support in December 2022\e[0m" echo -e "\e[33mmailcow will drop the Docker-Compose v1 Support in December 2022\e[0m"