AArch64 support 70/1670/3
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Fri, 27 Sep 2019 21:47:45 +0000 (23:47 +0200)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Fri, 27 Sep 2019 22:48:37 +0000 (00:48 +0200)
- spec: change hardcoded x86_64 arch to current platform arch;
- Dockerfile: parameterize hardcoded amd64 host arch;

Co-authored-by: Jimmy Lafontaine Rivera <lafonj@gmail.com>
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Change-Id: I3679acd4cc987c0580422889b77518e32b080dcc

docker-build/kubedns/Dockerfile
rpmbuild.spec

index 6182bd7..bbe5029 100644 (file)
@@ -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 \
index cfb8c6d..4824030 100644 (file)
@@ -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