From b6b22d79a64055410e3af3bc519228718a3c018e Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Fri, 27 Sep 2019 23:47:45 +0200 Subject: [PATCH 1/1] AArch64 support - spec: change hardcoded x86_64 arch to current platform arch; - Dockerfile: parameterize hardcoded amd64 host arch; Co-authored-by: Jimmy Lafontaine Rivera Signed-off-by: Alexandru Avadanii Change-Id: I3679acd4cc987c0580422889b77518e32b080dcc --- docker-build/kubedns/Dockerfile | 7 ++++--- rpmbuild.spec | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docker-build/kubedns/Dockerfile b/docker-build/kubedns/Dockerfile index 6182bd7..bbe5029 100644 --- a/docker-build/kubedns/Dockerfile +++ b/docker-build/kubedns/Dockerfile @@ -38,9 +38,10 @@ RUN apk update \ && mkdir -p $GOPATH/src/k8s.io/dns \ && curl -fsSL -k https://github.com/kubernetes/dns/archive/${KUBEDNS_VERSION}.tar.gz | tar zx --strip-components=1 -C $GOPATH/src/k8s.io/dns \ && cd $GOPATH/src/k8s.io/dns \ -&& PKG=k8s.io/dns ARCH=amd64 VERSION=${KUBEDNS_VERSION} ./build/build.sh \ -&& mv $GOPATH/bin/linux_amd64/kube-dns /usr/bin/kube-dns \ -&& mv $GOPATH/bin/linux_amd64/dnsmasq-nanny /usr/bin/dnsmasq-nanny \ +&& if [ $(uname -m) == 'aarch64' ]; then HOST_ARCH=arm64; else HOST_ARCH=amd64; ARCH_SUBDIR=linux_amd64; fi \ +&& PKG=k8s.io/dns ARCH=${HOST_ARCH} VERSION=${KUBEDNS_VERSION} ./build/build.sh \ +&& mv $GOPATH/bin/${ARCH_SUBDIR:-}/kube-dns /usr/bin/kube-dns \ +&& mv $GOPATH/bin/${ARCH_SUBDIR:-}/dnsmasq-nanny /usr/bin/dnsmasq-nanny \ && setcap 'cap_net_bind_service=+ep' /usr/sbin/dnsmasq \ && apk del .build-deps \ && rm -rf $GOPATH \ diff --git a/rpmbuild.spec b/rpmbuild.spec index cfb8c6d..4824030 100644 --- a/rpmbuild.spec +++ b/rpmbuild.spec @@ -25,7 +25,7 @@ Release: %{RPM_MINOR_VERSION}%{?dist} Summary: Containers as a Service Kube DNS component License: %{_platform_license} and Apache License and GNU Lesser General Public License v3.0 only and BSD 3-clause New or Revised License and MIT License and Common Development and Distribution License and BSD and GNU General Public License v2.0 only URL: https://github.com/kubernetes/dns -BuildArch: x86_64 +BuildArch: %{_arch} Vendor: %{_platform_vendor} and Kubernetes DNS service unmodified Source0: %{name}-%{version}.tar.gz -- 2.16.6