address comments

pull/6/head
m1093782566 2016-09-10 07:30:48 -04:00
parent ffc77eff71
commit be889f892a
2 changed files with 7 additions and 6 deletions

View File

@ -31,8 +31,7 @@ ALL_ARCH = amd64 arm arm64 ppc64le
GOARM=6
TEMP_DIR := $(shell mktemp -d)
KUBE_CROSS_IMAGE = gcr.io/google_containers/kube-cross
KUBE_CROSS_VERSION = $(shell cat ../../../build/build-image/cross/VERSION)
GOLANG_VERSION = 1.6.3
BIN = serve_hostname
SRCS = serve_hostname.go
@ -74,7 +73,7 @@ bin/$(BIN)-$(ARCH): $(SRCS)
cp ./* $(TEMP_DIR)
docker run -it -v $(TEMP_DIR):/build \
$(KUBE_CROSS_IMAGE):$(KUBE_CROSS_VERSION) \
golang:$(GOLANG_VERSION) \
/bin/bash -c "\
cd /build && \
CGO_ENABLED=0 GOARM=$(GOARM) GOARCH=$(ARCH) go build -a -installsuffix cgo --ldflags '-w' -o $(BIN) ./$(SRCS)"
@ -86,7 +85,7 @@ container: .container-$(ARCH)
docker build -t $(IMAGE):$(TAG) $(TEMP_DIR)
if [ -n "$(TEST_REGISTRY)" ]; then \
docker tag -f $(IMAGE):$(TAG) $(TEST_IMAGE):$(TAG) ;\
docker tag $(IMAGE):$(TAG) $(TEST_IMAGE):$(TAG) ;\
fi
push: .push-$(ARCH)

View File

@ -10,8 +10,10 @@ If you are releasing a new version, please bump the `TAG` value in the `Makefile
## How to release:
```
# Build cross-platform binaries
$ make all-push
# Build for linux/amd64 (default)
$ make push
$ make push ARCH=amd64
# ---> gcr.io/google_containers/serve_hostname-amd64:TAG
@ -25,7 +27,7 @@ $ make push ARCH=ppc64le
# ---> gcr.io/google_containers/serve_hostname-ppc64le:TAG
```
Of course, if you don't want to push the images, just run `make container`
Of course, if you don't want to push the images, run `make all-container` or `make container ARCH={target_arch}` instead.
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/contrib/for-demos/serve_hostname/README.md?pixel)]()