diff --git a/weave b/weave index 85158fd3..9d6bb1f4 100755 --- a/weave +++ b/weave @@ -12,6 +12,18 @@ fi IMAGE_VERSION=${VERSION:-$IMAGE_VERSION} +# These are potentially used for remote execs, and have defaults, so +# we introduce them here +DOCKER_BRIDGE=${DOCKER_BRIDGE:-docker0} +PROCFS=${PROCFS:-/proc} + +BASE_IMAGE=$DOCKERHUB_USER/weave +BASE_DNS_IMAGE=$DOCKERHUB_USER/weavedns +BASE_EXEC_IMAGE=$DOCKERHUB_USER/weaveexec +IMAGE=$BASE_IMAGE:$IMAGE_VERSION +DNS_IMAGE=$BASE_DNS_IMAGE:$IMAGE_VERSION +EXEC_IMAGE=$BASE_EXEC_IMAGE:$IMAGE_VERSION + usage() { echo "Usage:" echo "weave setup" @@ -37,20 +49,6 @@ usage() { exit 1 } -[ $# -gt 0 ] || usage - -# These are potentially used for remote execs, and have defaults, so -# we introduce them here -DOCKER_BRIDGE=${DOCKER_BRIDGE:-docker0} -PROCFS=${PROCFS:-/proc} - -BASE_IMAGE=$DOCKERHUB_USER/weave -BASE_DNS_IMAGE=$DOCKERHUB_USER/weavedns -BASE_EXEC_IMAGE=$DOCKERHUB_USER/weaveexec -IMAGE=$BASE_IMAGE:$IMAGE_VERSION -DNS_IMAGE=$BASE_DNS_IMAGE:$IMAGE_VERSION -EXEC_IMAGE=$BASE_EXEC_IMAGE:$IMAGE_VERSION - exec_remote() { docker run --rm \ -v /var/run/docker.sock:/var/run/docker.sock \ @@ -66,6 +64,8 @@ exec_remote() { $EXEC_IMAGE --local "$@" } +[ $# -gt 0 ] || usage + # "run" is a special case because we want to use docker directly, # rather than the docker in $EXEC_IMAGE remotely. That's because we # are passing arbitrary arguments on to docker run, and we can't rely