From 0ea51906cd918fd8a226d215aa307fff977b1645 Mon Sep 17 00:00:00 2001 From: "Santiago M. Mola" Date: Fri, 3 Jul 2020 12:04:47 +0200 Subject: [PATCH] pass COMPOSE_PROJECT_NAME env var in container mode Avoids the surprise of finding the project name set to the directory name when COMPOSE_PROJECT_NAME is being used. Signed-off-by: Santiago M. Mola --- script/run/run.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/script/run/run.sh b/script/run/run.sh index f7be36b60..a6de02f73 100755 --- a/script/run/run.sh +++ b/script/run/run.sh @@ -38,6 +38,9 @@ if [ -n "$COMPOSE_FILE" ]; then COMPOSE_OPTIONS="$COMPOSE_OPTIONS -e COMPOSE_FILE=$COMPOSE_FILE" compose_dir=$(realpath "$(dirname "$COMPOSE_FILE")") fi +if [ -n "$COMPOSE_PROJECT_NAME" ]; then + COMPOSE_OPTIONS="-e COMPOSE_PROJECT_NAME $COMPOSE_OPTIONS" +fi # TODO: also check --file argument if [ -n "$compose_dir" ]; then VOLUMES="$VOLUMES -v $compose_dir:$compose_dir"