3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
16 MAINTAINER Balazs Szekeres <balazs.szekeres@nokia.com>
19 ENV KUBEDNS_VERSION=$KUBEDNS
21 ENV PATH /usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
26 && apk add --update libcap \
27 && adduser -u 145 -D -H -s /sbin/nologin kubedns \
28 && mkdir -p /home/kubedns \
29 && chown -R kubedns:kubedns /home/kubedns \
30 && chown -R kubedns:kubedns /etc \
31 && apk add --no-cache --virtual .build-deps build-base git mercurial go glide bash tar curl \
32 && apk add --no-cache dnsmasq \
33 && mkdir -p $GOPATH/src/k8s.io/dns \
34 && curl -fsSL -k https://github.com/kubernetes/dns/archive/${KUBEDNS_VERSION}.tar.gz | tar zx --strip-components=1 -C $GOPATH/src/k8s.io/dns \
35 && cd $GOPATH/src/k8s.io/dns \
36 && PKG=k8s.io/dns ARCH=amd64 VERSION=${KUBEDNS_VERSION} ./build/build.sh \
37 && mv $GOPATH/bin/linux_amd64/kube-dns /usr/bin/kube-dns \
38 && mv $GOPATH/bin/linux_amd64/dnsmasq-nanny /usr/bin/dnsmasq-nanny \
39 && setcap 'cap_net_bind_service=+ep' /usr/sbin/dnsmasq \
40 && apk del .build-deps \
43 && rm -rf /root/.glide
46 ENV HOME /home/kubedns