&& 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 \
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