Support remote docker hosts on OS X.

This commit brings two main changes, notably:

Two new options that can be set as environment variables

- DOCKER_OPTS: any arbitrary set of docker options. Example: --tlsverify
- DOCKER_NATIVE: This forces the use of the native docker available.
                 This is most useful if you're on OS X and do not want
                 to use boot2docker.

Now uses 'docker cp' instead of tar piping to transfer files. This
currently must be done by copying the binaries off of the docker volume
and into a local filesystem (/tmp) before a docker cp is done. This
workaround will no longer be necessary after bug fix
https://github.com/docker/docker/pull/8509 makes it into stable.

This was necessary because the tar | tar method was creating corrupted
archives on OS X even with the < /dev/null workaround.
This commit is contained in:
James Kyle
2014-11-26 13:51:29 -08:00
parent 00477c3813
commit 361c8dbae5
2 changed files with 87 additions and 58 deletions

View File

@@ -17,6 +17,9 @@
# This command builds and runs a local kubernetes cluster. It's just like
# local-up.sh, but this one launches the three separate binaries.
# You may need to run this as root to allow kubelet to open docker's socket.
DOCKER_OPTS=${DOCKER_OPTS:-""}
DOCKER_NATIVE=${DOCKER_NATIVE:-""}
DOCKER=(docker ${DOCKER_OPTS})
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
cd "${KUBE_ROOT}"
@@ -27,7 +30,7 @@ set -e
source "${KUBE_ROOT}/hack/lib/init.sh"
"${KUBE_ROOT}/hack/build-go.sh"
docker ps 2> /dev/null 1> /dev/null
${DOCKER[@]} ps 2> /dev/null 1> /dev/null
if [ "$?" != "0" ]; then
echo "Failed to successfully run 'docker ps', please verify that docker is installed and \$DOCKER_HOST is set correctly."
exit 1