forked from cilium/cilium
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.deps
64 lines (58 loc) · 2.6 KB
/
Dockerfile.deps
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
FROM ubuntu:16.04
LABEL "Maintainer: Andre Martins <[email protected]>"
RUN mkdir -p /tmp/cilium-net-build/src/github.com/cilium/cilium
ADD ./contrib/packaging/docker/clang-3.8.1.key /tmp/cilium-net-build/src/github.com/cilium/cilium/contrib/packaging/docker/clang-3.8.1.key
RUN apt-get update && \
apt-get install -y --no-install-recommends gcc make libelf-dev bison flex git ca-certificates libc6-dev.i386 iptables libgcc-5-dev binutils && \
# 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
# bpf-map-begin
curl -SsL https://github.com/cilium/bpf-map/releases/download/v1.0/bpf-map -o bpf-map && \
chmod +x bpf-map && \
mv bpf-map /usr/bin && \
# bpf-map-end
# cni-begin
#Include the loopback binary in the image
mkdir -p tmp && cd tmp && \
curl -sS -L https://storage.googleapis.com/kubernetes-release/network-plugins/cni-0799f5732f2a11b329d9e3d51b9c8f2e3759f2ff.tar.gz -o cni.tar.gz && \
tar -xvf cni.tar.gz && \
mkdir /cni && \
cp bin/loopback /cni && \
cd .. && \
rm -r tmp && \
# cni-end
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:$GOPATH/bin:$PATH" && \
go get -u github.com/jteeuwen/go-bindata/...