From 10b5da85fab41c68c2c223a3a8749be9719908f6 Mon Sep 17 00:00:00 2001 From: Akira Ajisaka Date: Tue, 20 Nov 2018 23:59:08 +0900 Subject: [PATCH] HADOOP-14739. Update start-build-env.sh and build instruction for docker for Mac instead of docker toolbox. Contributed by Dinesh Chitlangia. --- BUILDING.txt | 10 +--------- start-build-env.sh | 13 +++++++------ 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/BUILDING.txt b/BUILDING.txt index d35e3af889..d781c2ca0b 100644 --- a/BUILDING.txt +++ b/BUILDING.txt @@ -26,19 +26,11 @@ The easiest way to get an environment with all the appropriate tools is by means of the provided Docker config. This requires a recent version of docker (1.4.1 and higher are known to work). -On Linux: +On Linux / Mac: Install Docker and run this command: $ ./start-build-env.sh -On Mac: - First make sure Virtualbox and docker toolbox are installed. - You can use docker toolbox as described in http://docs.docker.com/mac/step_one/. - $ docker-machine create --driver virtualbox \ - --virtualbox-memory "4096" hadoopdev - $ eval $(docker-machine env hadoopdev) - $ ./start-build-env.sh - The prompt which is then presented is located at a mounted version of the source tree and all required tools for testing and building have been installed and configured. diff --git a/start-build-env.sh b/start-build-env.sh index e3d9f2ff95..08cdfb0975 100755 --- a/start-build-env.sh +++ b/start-build-env.sh @@ -21,9 +21,14 @@ cd "$(dirname "$0")" # connect to root docker build -t hadoop-build dev-support/docker +USER_NAME=${SUDO_USER:=$USER} +USER_ID=$(id -u "${USER_NAME}") + +if [ "$(uname -s)" = "Darwin" ]; then + GROUP_ID=100 +fi + if [ "$(uname -s)" = "Linux" ]; then - USER_NAME=${SUDO_USER:=$USER} - USER_ID=$(id -u "${USER_NAME}") GROUP_ID=$(id -g "${USER_NAME}") # man docker-run # When using SELinux, mounted directories may not be accessible @@ -51,10 +56,6 @@ if [ "$(uname -s)" = "Linux" ]; then done fi fi -else # boot2docker uid and gid - USER_NAME=$USER - USER_ID=1000 - GROUP_ID=50 fi docker build -t "hadoop-build-${USER_ID}" - <