AArch64 support
[ta/caas-danm.git] / docker-build / flannel / Dockerfile
1 # Copyright 2019 Nokia
2 #
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
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
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.
14
15 FROM alpine:3.9
16 MAINTAINER Levente Kale <levente.kale@nokia.com>
17
18 ARG FLANNEL
19 ENV FLANNEL_VERSION=$FLANNEL
20
21 RUN apk add --no-cache wget iproute2 net-tools ca-certificates iptables strongswan && update-ca-certificates && \
22     apk add wireguard-tools --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community
23
24 RUN mkdir -p /opt/bin && \
25     if [ $(uname -m) == 'aarch64' ]; then HOST_ARCH=arm64; else HOST_ARCH=amd64; fi && \
26     wget -O /opt/bin/flanneld https://github.com/coreos/flannel/releases/download/v${FLANNEL_VERSION}/flanneld-${HOST_ARCH} && \
27     chmod +x /opt/bin/flanneld && \
28     wget -O /opt/bin/mk-docker-opts.sh https://github.com/coreos/flannel/blob/v${FLANNEL_VERSION}/dist/mk-docker-opts.sh
29
30 ENTRYPOINT ["/opt/bin/flanneld"]