mirror of https://github.com/k3s-io/k3s
address comments
parent
ffc77eff71
commit
be889f892a
|
@ -31,8 +31,7 @@ ALL_ARCH = amd64 arm arm64 ppc64le
|
||||||
|
|
||||||
GOARM=6
|
GOARM=6
|
||||||
TEMP_DIR := $(shell mktemp -d)
|
TEMP_DIR := $(shell mktemp -d)
|
||||||
KUBE_CROSS_IMAGE = gcr.io/google_containers/kube-cross
|
GOLANG_VERSION = 1.6.3
|
||||||
KUBE_CROSS_VERSION = $(shell cat ../../../build/build-image/cross/VERSION)
|
|
||||||
|
|
||||||
BIN = serve_hostname
|
BIN = serve_hostname
|
||||||
SRCS = serve_hostname.go
|
SRCS = serve_hostname.go
|
||||||
|
@ -74,7 +73,7 @@ bin/$(BIN)-$(ARCH): $(SRCS)
|
||||||
cp ./* $(TEMP_DIR)
|
cp ./* $(TEMP_DIR)
|
||||||
|
|
||||||
docker run -it -v $(TEMP_DIR):/build \
|
docker run -it -v $(TEMP_DIR):/build \
|
||||||
$(KUBE_CROSS_IMAGE):$(KUBE_CROSS_VERSION) \
|
golang:$(GOLANG_VERSION) \
|
||||||
/bin/bash -c "\
|
/bin/bash -c "\
|
||||||
cd /build && \
|
cd /build && \
|
||||||
CGO_ENABLED=0 GOARM=$(GOARM) GOARCH=$(ARCH) go build -a -installsuffix cgo --ldflags '-w' -o $(BIN) ./$(SRCS)"
|
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)
|
docker build -t $(IMAGE):$(TAG) $(TEMP_DIR)
|
||||||
if [ -n "$(TEST_REGISTRY)" ]; then \
|
if [ -n "$(TEST_REGISTRY)" ]; then \
|
||||||
docker tag -f $(IMAGE):$(TAG) $(TEST_IMAGE):$(TAG) ;\
|
docker tag $(IMAGE):$(TAG) $(TEST_IMAGE):$(TAG) ;\
|
||||||
fi
|
fi
|
||||||
|
|
||||||
push: .push-$(ARCH)
|
push: .push-$(ARCH)
|
||||||
|
|
|
@ -10,8 +10,10 @@ If you are releasing a new version, please bump the `TAG` value in the `Makefile
|
||||||
## How to release:
|
## How to release:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
# Build cross-platform binaries
|
||||||
|
$ make all-push
|
||||||
|
|
||||||
# Build for linux/amd64 (default)
|
# Build for linux/amd64 (default)
|
||||||
$ make push
|
|
||||||
$ make push ARCH=amd64
|
$ make push ARCH=amd64
|
||||||
# ---> gcr.io/google_containers/serve_hostname-amd64:TAG
|
# ---> gcr.io/google_containers/serve_hostname-amd64:TAG
|
||||||
|
|
||||||
|
@ -25,7 +27,7 @@ $ make push ARCH=ppc64le
|
||||||
# ---> gcr.io/google_containers/serve_hostname-ppc64le:TAG
|
# ---> 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)]()
|
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/contrib/for-demos/serve_hostname/README.md?pixel)]()
|
||||||
|
|
Loading…
Reference in New Issue