Skip to content

Commit b9631a8

Browse files
authored
Merge pull request kubernetes#73231 from liggitt/add-on-arch-build
Enable multi-arch build for add-on manager
2 parents 9f4a495 + af66376 commit b9631a8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cluster/addons/addon-manager/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ KUBECTL_VERSION?=v1.13.2
2020

2121
BASEIMAGE=k8s.gcr.io/debian-base-$(ARCH):0.4.0
2222

23+
SUDO=$(if $(filter 0,$(shell id -u)),,sudo)
24+
2325
.PHONY: build push
2426

2527
all: build
@@ -29,6 +31,12 @@ build:
2931
curl -sSL --retry 5 https://dl.k8s.io/release/$(KUBECTL_VERSION)/bin/linux/$(ARCH)/kubectl > $(TEMP_DIR)/kubectl
3032
chmod +x $(TEMP_DIR)/kubectl
3133
cd $(TEMP_DIR) && sed -i.back "s|BASEIMAGE|$(BASEIMAGE)|g" Dockerfile
34+
35+
ifneq ($(ARCH),amd64)
36+
# Register /usr/bin/qemu-ARCH-static as the handler for non-x86 binaries in the kernel
37+
$(SUDO) ../../../third_party/multiarch/qemu-user-static/register/register.sh --reset
38+
endif
39+
3240
docker build --pull -t $(IMAGE)-$(ARCH):$(VERSION) $(TEMP_DIR)
3341

3442
push: build

0 commit comments

Comments
 (0)