From f23acfa30b398cb5fcd692d58f06b1591e255726 Mon Sep 17 00:00:00 2001 From: Ernesto Puerta Date: Thu, 25 Jan 2024 17:21:07 +0100 Subject: [PATCH] docker-compose: support v1 and v2 Fixes: #393 The main difference between docker compose v1 and v2 is that v1 commnad is `docker-compose`, while v2 is usually a split subcommand `docker compose`. Signed-off-by: Ernesto Puerta --- mk/containerized.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mk/containerized.mk b/mk/containerized.mk index 5669423d..c2463875 100644 --- a/mk/containerized.mk +++ b/mk/containerized.mk @@ -2,7 +2,11 @@ # Docker and docker-compose specific commands DOCKER = docker -DOCKER_COMPOSE = docker-compose ## Docker-compose command +# Docker-compose v1 or v2 +DOCKER_COMPOSE != command -v docker-compose || (DOCKER=$$(command -v docker) && printf "%s compose\n" $$DOCKER) +ifndef DOCKER_COMPOSE +$(error DOCKER_COMPOSE command not found. Please install from: https://docs.docker.com/engine/install/)) +endif DOCKER_COMPOSE_COMMANDS = pull build up run exec ps top images logs port \ pause unpause stop restart down events