From 5a53ce182a44c410748b873b23aae791625a54b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Elek?= Date: Mon, 25 Feb 2019 11:01:27 +0100 Subject: [PATCH] HADOOP-16146. Make start-build-env.sh safe in case of misusage of DOCKER_INTERACTIVE_RUN. Contributed by Elek, Marton. --- start-build-env.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/start-build-env.sh b/start-build-env.sh index 08cdfb09752ff..09c7cec23b0ab 100755 --- a/start-build-env.sh +++ b/start-build-env.sh @@ -67,15 +67,19 @@ ENV HOME /home/${USER_NAME} UserSpecificDocker -#If this env varible is empty, docker will be started -# in non interactive mode -DOCKER_INTERACTIVE_RUN=${DOCKER_INTERACTIVE_RUN-"-i -t"} +#If this env varible is true, docker will be started +# in interactive mode +if [ "${DOCKER_INTERACTIVE_RUN:-true}" = true ]; then + DOCKER_IT_FLAGS="-i -t" +else + DOCKER_IT_FLAGS="" +fi # By mapping the .m2 directory you can do an mvn install from # within the container and use the result on your normal # system. And this also is a significant speedup in subsequent # builds because the dependencies are downloaded only once. -docker run --rm=true $DOCKER_INTERACTIVE_RUN \ +docker run --rm=true $DOCKER_IT_FLAGS \ -v "${PWD}:/home/${USER_NAME}/hadoop${V_OPTS:-}" \ -w "/home/${USER_NAME}/hadoop" \ -v "${HOME}/.m2:/home/${USER_NAME}/.m2${V_OPTS:-}" \