Merge pull request #73231 from liggitt/add-on-arch-build

Enable multi-arch build for add-on manager
pull/564/head
Kubernetes Prow Robot 2019-01-23 16:19:35 -08:00 committed by GitHub
commit b9631a881f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -20,6 +20,8 @@ KUBECTL_VERSION?=v1.13.2
BASEIMAGE=k8s.gcr.io/debian-base-$(ARCH):0.4.0
SUDO=$(if $(filter 0,$(shell id -u)),,sudo)
.PHONY: build push
all: build
@ -29,6 +31,12 @@ build:
curl -sSL --retry 5 https://dl.k8s.io/release/$(KUBECTL_VERSION)/bin/linux/$(ARCH)/kubectl > $(TEMP_DIR)/kubectl
chmod +x $(TEMP_DIR)/kubectl
cd $(TEMP_DIR) && sed -i.back "s|BASEIMAGE|$(BASEIMAGE)|g" Dockerfile
ifneq ($(ARCH),amd64)
# Register /usr/bin/qemu-ARCH-static as the handler for non-x86 binaries in the kernel
$(SUDO) ../../../third_party/multiarch/qemu-user-static/register/register.sh --reset
endif
docker build --pull -t $(IMAGE)-$(ARCH):$(VERSION) $(TEMP_DIR)
push: build