Change-Id: Idb89bd0457419bbeb3655ec5d8c40b2902f34fe6
Signed-off-by: Balazs Szekeres <balazs.szekeres@nokia.com>
FROM alpine:3.9
MAINTAINER Balazs Szekeres <balazs.szekeres@nokia.com>
FROM alpine:3.9
MAINTAINER Balazs Szekeres <balazs.szekeres@nokia.com>
-ARG KUBEDNS
-ENV KUBEDNS_VERSION=$KUBEDNS
-ENV PATH /usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ARG go_install_dir="/usr/local/go"
+ARG go_version
+ENV PATH="$go_install_dir/bin:$PATH"
RUN apk update \
&& apk upgrade \
RUN apk update \
&& apk upgrade \
&& chown -R kubedns:kubedns /etc \
&& apk add --no-cache --virtual .build-deps build-base git mercurial go glide bash tar curl \
&& apk add --no-cache dnsmasq \
&& chown -R kubedns:kubedns /etc \
&& apk add --no-cache --virtual .build-deps build-base git mercurial go glide bash tar curl \
&& apk add --no-cache dnsmasq \
+&& mkdir -p $go_install_dir \
+&& curl -fsSL -k https://dl.google.com/go/go${go_version}.src.tar.gz | tar zx --strip-components=1 -C ${go_install_dir} \
+&& cd ${go_install_dir}/src/ \
+&& ./make.bash \
&& 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 \
&& 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 \
&& setcap 'cap_net_bind_service=+ep' /usr/sbin/dnsmasq \
&& apk del .build-deps \
&& rm -rf $GOPATH \
&& setcap 'cap_net_bind_service=+ep' /usr/sbin/dnsmasq \
&& apk del .build-deps \
&& rm -rf $GOPATH \
+&& rm -rf $go_install_dir \
&& rm -rf /build \
&& rm -rf /root/.glide
&& rm -rf /build \
&& rm -rf /root/.glide
%define COMPONENT kubedns
%define RPM_NAME caas-%{COMPONENT}
%define RPM_MAJOR_VERSION 1.15.4
%define COMPONENT kubedns
%define RPM_NAME caas-%{COMPONENT}
%define RPM_MAJOR_VERSION 1.15.4
-%define RPM_MINOR_VERSION 2
+%define RPM_MINOR_VERSION 3
%define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION}
%define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION}
+%define go_version 1.12.9
Name: %{RPM_NAME}
Version: %{RPM_MAJOR_VERSION}
Name: %{RPM_NAME}
Version: %{RPM_MAJOR_VERSION}
--build-arg http_proxy="${http_proxy}" \
--build-arg https_proxy="${https_proxy}" \
--build-arg no_proxy="${no_proxy}" \
--build-arg http_proxy="${http_proxy}" \
--build-arg https_proxy="${https_proxy}" \
--build-arg no_proxy="${no_proxy}" \
- --build-arg KUBEDNS="%{RPM_MAJOR_VERSION}" \
+ --build-arg KUBEDNS_VERSION="%{RPM_MAJOR_VERSION}" \
+ --build-arg go_version="%{go_version}" \
--tag %{COMPONENT}:%{IMAGE_TAG} \
%{_builddir}/%{RPM_NAME}-%{RPM_MAJOR_VERSION}/docker-build/%{COMPONENT}/
--tag %{COMPONENT}:%{IMAGE_TAG} \
%{_builddir}/%{RPM_NAME}-%{RPM_MAJOR_VERSION}/docker-build/%{COMPONENT}/