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.
pull/341/head
snoe925 2019-11-11 11:00:20 -06:00 committed by GitHub
parent 95ba042c83
commit 9178870e6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -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