From 9178870e6f6c1189900ac3610286a039787041ee Mon Sep 17 00:00:00 2001 From: snoe925 Date: Mon, 11 Nov 2019 11:00:20 -0600 Subject: [PATCH] Update build-docker.sh for other platforms The helper realpath does not exist on OS X. Check for the implementation before using. Testing on Docker for Mac. Docker for Mac requires that you increase the size of the Docker VM to match the disk space used in the build. I am using 256G. Allow DOCKER to be set. On systems without open docker commands, support DOCKER="sudo docker" bash build-docker.sh. Testing this on ClearLinux. --- build-docker.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build-docker.sh b/build-docker.sh index 583bf6a..77e6110 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -3,7 +3,8 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" BUILD_OPTS="$*" -DOCKER="docker" +# Set DOCKER="sudo docker" if needed +DOCKER=${DOCKER:-"docker"} if ! ${DOCKER} ps >/dev/null 2>&1; then DOCKER="sudo docker" @@ -31,7 +32,10 @@ do done # Ensure that the configuration file is an absolute path -CONFIG_FILE=$(realpath -s "$CONFIG_FILE") +# on OS X realpath is not available +if [ -x /usr/bin/realpath ]; then + CONFIG_FILE=$(realpath -s "$CONFIG_FILE") +fi # Ensure that the confguration file is present if test -z "${CONFIG_FILE}"; then