forked from cilium/cilium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
67 lines (60 loc) · 2.44 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
FROM ubuntu:16.04
LABEL "Maintainer: Andre Martins <[email protected]>"
ADD . /tmp/cilium-net-build/src/github.com/cilium/cilium
RUN apt-get update && \
apt-get install -y --no-install-recommends gcc make libelf-dev bison flex git libc6-dev.i386 && \
#
# clang-3.8.1-begin
apt-get install -y --no-install-recommends curl xz-utils && \
cd /tmp && \
gpg --import /tmp/cilium-net-build/src/github.com/cilium/cilium/contrib/packaging/docker/clang-3.8.1.key && \
curl -Ssl -o clang+llvm.tar.xz \
http://releases.llvm.org/3.8.1/clang+llvm-3.8.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz && \
curl -Ssl -o clang+llvm.tar.xz.sig \
http://releases.llvm.org/3.8.1/clang+llvm-3.8.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz.sig && \
gpg --verify clang+llvm.tar.xz.sig && \
mkdir -p /usr/local && \
tar -C /usr/local -xJf ./clang+llvm.tar.xz && \
mv /usr/local/clang+llvm-3.8.1-x86_64-linux-gnu-ubuntu-16.04 /usr/local/clang+llvm && \
rm clang+llvm.tar.xz && \
rm -fr /usr/local/clang+llvm/include/llvm-c && \
rm -fr /usr/local/clang+llvm/include/clang-c && \
rm -fr /usr/local/clang+llvm/include/c++ && \
rm -fr /usr/local/clang+llvm/share && \
ls -d /usr/local/clang+llvm/lib/* | grep -vE clang$ | xargs rm -r && \
ls -d /usr/local/clang+llvm/bin/* | grep -vE "clang$|clang-3.8$|llc$" | xargs rm -r && \
# clang-3.8.1-end
#
# iproute2-begin
cd /tmp && \
git clone -b v4.10.0 git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git && \
cd /tmp/iproute2 && \
./configure && \
make -j `getconf _NPROCESSORS_ONLN` && \
make install && \
# iproute2-end
#
# cilium-begin
cd /tmp && \
curl -Sslk -o go.linux-amd64.tar.gz \
https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz && \
tar -C /usr/local -xzf go.linux-amd64.tar.gz && \
cd /tmp/cilium-net-build/src/github.com/cilium/cilium && \
export GOROOT=/usr/local/go && \
export GOPATH=/tmp/cilium-net-build && \
export PATH="$GOROOT/bin:/usr/local/clang+llvm/bin:$PATH" && \
make && \
make PKG_BUILD=1 install && \
groupadd -f cilium && \
# cilium-end
#
apt-get purge --auto-remove -y gcc make bison flex git curl xz-utils && \
# Needed for system minimal requirements checkers
apt-get install -y --no-install-recommends libgcc-5-dev binutils && \
apt-get clean && \
rm -fr /root /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/local/go
ADD plugins/cilium-cni/cni-install.sh /cni-install.sh
ADD plugins/cilium-cni/cni-uninstall.sh /cni-uninstall.sh
ENV PATH="/usr/local/clang+llvm/bin:$PATH"
ENV INITSYSTEM="SYSTEMD"
CMD ["/usr/bin/cilium"]