From e2891e1d90e903407f6031fac07fdb243a9929a5 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Mon, 16 Sep 2024 12:03:17 -0600 Subject: [PATCH] check for docker compose command in Makefiles Signed-off-by: Mic Bowman --- docker/Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docker/Makefile b/docker/Makefile index 174f31eb..bef23a51 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -49,7 +49,15 @@ PDO_USER_UID ?= $(shell id -u) PDO_GROUP_UID ?= $(shell id -g) DOCKER_COMMAND ?= docker -DOCKER_COMPOSE_COMMAND ?= docker-compose + +ifndef DOCKER_COMPOSE_COMMAND + DOCKER_COMPOSE_COMMAND := $(shell command -v docker-compose 2> /dev/null) + ifndef DOCKER_COMPOSE_COMMAND + $(warning "docker-compose command is not available") + DOCKER_COMPOSE_COMMAND := $(DOCKER_COMMAND) compose + endif +endif + # to work with upstream docker and docker compose plugin, redefine above # as `DOCKER_COMPOSE_COMMAND=docker compose` in your `make.loc`