mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
Make it possible to compile both etcd2 and etcd3 in the Makefile and compile attachlease for multiple arches as well
This commit is contained in:
parent
456c78a806
commit
c9e794e1cb
@ -15,7 +15,7 @@
|
|||||||
# Build the etcd image
|
# Build the etcd image
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# [TAG=2.2.1] [REGISTRY=gcr.io/google_containers] [ARCH=amd64] [BASEIMAGE=busybox] make (build|push)
|
# [TAG=3.0.4] [REGISTRY=gcr.io/google_containers] [ARCH=amd64] [BASEIMAGE=busybox] make (build|push)
|
||||||
|
|
||||||
TAG?=3.0.4
|
TAG?=3.0.4
|
||||||
ARCH?=amd64
|
ARCH?=amd64
|
||||||
@ -42,8 +42,9 @@ build:
|
|||||||
# without copying the subdirectories.
|
# without copying the subdirectories.
|
||||||
find ./ -maxdepth 1 -type f | xargs cp -t $(TEMP_DIR)
|
find ./ -maxdepth 1 -type f | xargs cp -t $(TEMP_DIR)
|
||||||
|
|
||||||
make -C ../../../ WHAT=cluster/images/etcd/attachlease KUBE_STATIC_OVERRIDES="etcd";
|
# Compile attachlease
|
||||||
cp "../../../_output/bin/attachlease" $(TEMP_DIR)
|
docker run -it -v $(shell pwd)/../../../:/go/src/k8s.io/kubernetes -v $(TEMP_DIR):/build -e GOARCH=$(ARCH) golang:$(GOLANG_VERSION) \
|
||||||
|
/bin/bash -c "CGO_ENABLED=0 go build -o /build/attachlease k8s.io/kubernetes/cluster/images/etcd/attachlease"
|
||||||
|
|
||||||
ifeq ($(ARCH),amd64)
|
ifeq ($(ARCH),amd64)
|
||||||
|
|
||||||
@ -57,7 +58,7 @@ else
|
|||||||
&& cd /go/src/github.com/coreos/etcd \
|
&& cd /go/src/github.com/coreos/etcd \
|
||||||
&& git checkout v$(TAG) \
|
&& git checkout v$(TAG) \
|
||||||
&& GOARM=$(GOARM) GOARCH=$(ARCH) ./build \
|
&& GOARM=$(GOARM) GOARCH=$(ARCH) ./build \
|
||||||
&& cp bin/$(ARCH)/* /etcdbin"
|
&& cp -f bin/$(ARCH)/etcd* bin/etcd* /etcdbin; echo 'done'"
|
||||||
|
|
||||||
# Add this ENV variable in order to workaround an unsupported arch blocker
|
# Add this ENV variable in order to workaround an unsupported arch blocker
|
||||||
# The multiarch feature is in an limited and experimental state right now, and etcd should work fine on arm64
|
# The multiarch feature is in an limited and experimental state right now, and etcd should work fine on arm64
|
||||||
|
Loading…
Reference in New Issue
Block a user