You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by aa...@apache.org on 2020/10/20 01:11:45 UTC

[hadoop] branch branch-3.3 updated: HADOOP-17298. Backslash in username causes build failure in the environment started by start-build-env.sh. (#2367)

This is an automated email from the ASF dual-hosted git repository.

aajisaka pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/branch-3.3 by this push:
     new 0289cdc  HADOOP-17298. Backslash in username causes build failure in the environment started by start-build-env.sh. (#2367)
0289cdc is described below

commit 0289cdc43c909c2278894c72722218bcf367004f
Author: tkuramoto33 <70...@users.noreply.github.com>
AuthorDate: Tue Oct 20 10:09:03 2020 +0900

    HADOOP-17298. Backslash in username causes build failure in the environment started by start-build-env.sh. (#2367)
    
    Signed-off-by: Akira Ajisaka <aa...@apache.org>
    (cherry picked from commit a2e7a073f03f682d6716ed59c60533be09841784)
---
 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 fc54c7a..2ee44de 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}" - <<UserSpecificDocker
 FROM hadoop-build
 RUN rm -f /var/log/faillog /var/log/lastlog
 RUN groupadd --non-unique -g ${GROUP_ID} ${USER_NAME}
-RUN useradd -g ${GROUP_ID} -u ${USER_ID} -k /root -m ${USER_NAME}
+RUN useradd -g ${GROUP_ID} -u ${USER_ID} -k /root -m ${USER_NAME} -d "${DOCKER_HOME_DIR}"
 RUN echo "${USER_NAME} ALL=NOPASSWD: ALL" > "/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}" "$@"


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org