From 964be36991ff5398c6d5c7b7a24eb94f9adc18bc Mon Sep 17 00:00:00 2001 From: Johan Euphrosine Date: Thu, 25 Sep 2014 16:34:20 -0700 Subject: [PATCH] examples/guestbook-go: build from source and remove bin/docker dep --- examples/guestbook-go/_src/Dockerfile | 12 ++++++------ examples/guestbook-go/_src/script/build.sh | 13 +------------ 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/examples/guestbook-go/_src/Dockerfile b/examples/guestbook-go/_src/Dockerfile index c6889ed4b6b..65416f211d6 100644 --- a/examples/guestbook-go/_src/Dockerfile +++ b/examples/guestbook-go/_src/Dockerfile @@ -1,9 +1,9 @@ FROM google/golang:latest -RUN mkdir -p /gopath/src/github.com/GoogleCloudPlatform/ && cd /gopath/src/github.com/GoogleCloudPlatform/ && \ - git clone http://github.com/GoogleCloudPlatform/kubernetes && \ - cd /gopath/src/github.com/GoogleCloudPlatform/kubernetes/examples/guestbook-go/_src/ && \ - go get && go build -o ../bin/guestbook && \ - cp ./guestbook/Dockerfile /gopath/src/github.com/GoogleCloudPlatform/kubernetes/examples/guestbook-go/ +ADD . /gopath/src/github.com/GoogleCloudPlatform/kubernetes/examples/guestbook-go/_src -CMD docker build --rm --force-rm -t kubernetes/guestbook /gopath/src/github.com/GoogleCloudPlatform/kubernetes/examples/guestbook-go/ +WORKDIR /gopath/src/github.com/GoogleCloudPlatform/kubernetes/examples/guestbook-go/ +RUN cd _src/ && go get && go build -o ../bin/guestbook +RUN cp _src/guestbook/Dockerfile . + +CMD tar cvzf - . diff --git a/examples/guestbook-go/_src/script/build.sh b/examples/guestbook-go/_src/script/build.sh index ccff8c1a742..319db022209 100755 --- a/examples/guestbook-go/_src/script/build.sh +++ b/examples/guestbook-go/_src/script/build.sh @@ -20,16 +20,5 @@ set -o errexit set -o nounset set -o pipefail -if [[ "${DOCKER_BIN+set}" == "set" ]]; then - echo "Using DOCKER_BIN=\"${DOCKER_BIN}\" from the environment." -elif DOCKER_BIN=$(which docker); then - echo "Setting DOCKER_BIN=\"${DOCKER_BIN}\" from host machine." -else - echo "Could not find a working docker binary and none passed in DOCKER_BIN." >&2 - exit 1 -fi - docker build --rm --force-rm -t kubernetes/guestbook-build . -docker run --rm -v "${DOCKER_BIN}:/usr/local/bin/docker" \ - -v "/var/run/docker.sock:/var/run/docker.sock" \ - -ti --name guestbook-build kubernetes/guestbook-build +docker run --rm kubernetes/guestbook-build | docker build -t kubernetes/guestbook -