forked from redsift/ingraind-build
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile.18.04
96 lines (87 loc) · 3.17 KB
/
Dockerfile.18.04
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
FROM ubuntu:18.04
ARG openssl_arch=linux-x86_64
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get -y install \
curl \
wget \
lsb-release \
software-properties-common \
debhelper \
cmake \
libelf-dev \
bison \
flex \
libedit-dev \
python \
python-netaddr \
python-pyroute2 \
luajit \
libluajit-5.1-dev \
arping \
iperf \
netperf \
ethtool \
devscripts \
zlib1g-dev \
libfl-dev \
pkg-config \
libssl-dev \
git \
musl \
musl-tools \
musl-dev \
capnproto \
linux-base \
libkmod2 \
kmod \
&& add-apt-repository -y ppa:ubuntu-toolchain-r/test \
&& wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 14 && rm -f ./llvm.sh \
&& apt-get update && apt-get -y install llvm libllvm14 llvm-14-dev libclang-14-dev clang-format-14 clang \
&& apt-get clean -y
RUN ln -sf /usr/bin/llvm-config-14 /usr/bin/llvm-config
RUN llvm-config --version | grep -q '^14'
# Install kernel v4.19 to check the oldest supported kernel
WORKDIR /tmp/kernel
RUN wget \
https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.19.5/linux-headers-4.19.5-041905-generic_4.19.5-041905.201812031110_amd64.deb \
https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.19.5/linux-image-unsigned-4.19.5-041905-generic_4.19.5-041905.201812031110_amd64.deb \
https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.19.5/linux-modules-4.19.5-041905-generic_4.19.5-041905.201812031110_amd64.deb \
https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.19.5/linux-headers-4.19.5-041905_4.19.5-041905.201812031110_all.deb
RUN dpkg -i linux-*4.19.5*.deb
WORKDIR /
RUN rm -rf /tmp/kernel
RUN curl https://sh.rustup.rs -sSf > rustup.sh \
&& sh rustup.sh -y \
--default-toolchain stable \
--profile minimal \
--no-modify-path \
&& rustup component add rustfmt \
&& rustup target add x86_64-unknown-linux-musl \
&& rustup toolchain add nightly --profile minimal \
&& rustup --version \
&& cargo --version \
&& rustc --version \
&& cargo install bindgen-cli \
&& rm -f rustup.sh
RUN echo "Building OpenSSL" \
&& VERS=1.0.2p \
&& CHECKSUM=50a98e07b1a89eb8f6a99477f262df71c6fa7bef77df4dc83025a2845c827d00 \
&& curl -sqO https://www.openssl.org/source/openssl-$VERS.tar.gz \
&& echo "$CHECKSUM openssl-$VERS.tar.gz" > checksums.txt \
&& sha256sum -c checksums.txt \
&& tar xzf openssl-$VERS.tar.gz && cd openssl-$VERS \
&& CC=musl-gcc ./Configure ${openssl_arch} -fPIC --prefix=/usr/local/musl/$TARGET \
&& make depend \
&& make && make install \
&& cd .. && rm -rf openssl-$VERS.tar.gz openssl-$VERS checksums.txt
ENV OPENSSL_DIR=/usr/local/musl/$TARGET/ \
OPENSSL_INCLUDE_DIR=/usr/local/musl/$TARGET/include/ \
DEP_OPENSSL_INCLUDE=/usr/local/musl/$TARGET/include/ \
OPENSSL_LIB_DIR=/usr/local/musl/$TARGET/lib/ \
OPENSSL_STATIC=1
COPY yum/ /etc/yum/
WORKDIR /build