diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2192c5c1dc..77c42ba9d5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -38,6 +38,12 @@ run: $ script/build -osarch="darwin/amd64" +If you don't need to run the `docker build` to generate the image on each +compile, i.e. if you have built the image already, you can skip the image build +using the `SKIP_BUILD` environment variable, for instance: + + $ SKIP_BUILD=1 script/build -osarch="darwin/amd64" + If you have any questions we're in #docker-machine on Freenode. ## Unit Tests diff --git a/script/build b/script/build index 56fd71782d..115faf1ea1 100755 --- a/script/build +++ b/script/build @@ -13,6 +13,11 @@ else OS_ARCH_ARG=($2) fi -docker build -t docker-machine . +# Build Docker image unless we opt out of it +if [[ -z "$SKIP_BUILD" ]]; then + docker build -t docker-machine . +fi + +# Get rid of existing binaries rm -f docker-machine* docker run --rm -v `pwd`:/go/src/github.com/docker/machine docker-machine gox "${OS_PLATFORM_ARG[@]}" "${OS_ARCH_ARG[@]}" -output="docker-machine_{{.OS}}-{{.Arch}}" -ldflags="-w -X github.com/docker/machine/version.GITCOMMIT `git rev-parse --short HEAD`"