diff --git a/build/common.sh b/build/common.sh index 4bd6331b7b6..f97f38a1b90 100755 --- a/build/common.sh +++ b/build/common.sh @@ -173,7 +173,7 @@ function kube::build::docker_available_on_osx() { kube::log::status "No docker host is set. Checking options for setting one..." if [[ -z "$(which docker-machine)" && -z "$(which boot2docker)" ]]; then - kube::log::status "It looks like you're running Mac OS X, and neither Docker for Mac, docker-machine or boot2docker are nowhere to be found." + kube::log::status "It looks like you're running Mac OS X, yet none of Docker for Mac, docker-machine or boot2docker are on the path." kube::log::status "See: https://docs.docker.com/machine/ for installation instructions." return 1 elif [[ -n "$(which docker-machine)" ]]; then @@ -242,11 +242,15 @@ function kube::build::is_osx() { [[ "$(uname)" == "Darwin" ]] } +function kube::build::is_gnu_sed() { + [[ $(sed --version 2>&1) == *GNU* ]] +} + function kube::build::update_dockerfile() { - if kube::build::is_osx; then - sed_opts=(-i '') - else + if kube::build::is_gnu_sed; then sed_opts=(-i) + else + sed_opts=(-i '') fi sed "${sed_opts[@]}" "s/KUBE_BUILD_IMAGE_CROSS_TAG/${KUBE_BUILD_IMAGE_CROSS_TAG}/" "${LOCAL_OUTPUT_BUILD_CONTEXT}/Dockerfile" }