From a2e7a073f03f682d6716ed59c60533be09841784 Mon Sep 17 00:00:00 2001 From: tkuramoto33 <70622977+tkuramoto33@users.noreply.github.com> Date: Tue, 20 Oct 2020 10:09:03 +0900 Subject: [PATCH] HADOOP-17298. Backslash in username causes build failure in the environment started by start-build-env.sh. (#2367) Signed-off-by: Akira Ajisaka --- start-build-env.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/start-build-env.sh b/start-build-env.sh index fc54c7a998..2ee44de41a 100755 --- a/start-build-env.sh +++ b/start-build-env.sh @@ -66,13 +66,16 @@ if [ "$(uname -s)" = "Linux" ]; then fi fi +# Set the home directory in the Docker container. +DOCKER_HOME_DIR=${DOCKER_HOME_DIR:-/home/${USER_NAME}} + docker build -t "hadoop-build-${USER_ID}" - < "/etc/sudoers.d/hadoop-build-${USER_ID}" -ENV HOME /home/${USER_NAME} +ENV HOME "${DOCKER_HOME_DIR}" UserSpecificDocker @@ -85,9 +88,9 @@ DOCKER_INTERACTIVE_RUN=${DOCKER_INTERACTIVE_RUN-"-i -t"} # 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 \ - -v "${PWD}:/home/${USER_NAME}/hadoop${V_OPTS:-}" \ - -w "/home/${USER_NAME}/hadoop" \ - -v "${HOME}/.m2:/home/${USER_NAME}/.m2${V_OPTS:-}" \ - -v "${HOME}/.gnupg:/home/${USER_NAME}/.gnupg${V_OPTS:-}" \ + -v "${PWD}:${DOCKER_HOME_DIR}/hadoop${V_OPTS:-}" \ + -w "${DOCKER_HOME_DIR}/hadoop" \ + -v "${HOME}/.m2:${DOCKER_HOME_DIR}/.m2${V_OPTS:-}" \ + -v "${HOME}/.gnupg:${DOCKER_HOME_DIR}/.gnupg${V_OPTS:-}" \ -u "${USER_ID}" \ "hadoop-build-${USER_ID}" "$@"