diff --git a/start-build-env.sh b/start-build-env.sh index fc54c7a9985..2ee44de41aa 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}" "$@"