-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathDockerfile.builder
65 lines (58 loc) · 1.87 KB
/
Dockerfile.builder
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
FROM debian:bookworm
LABEL org.opencontainers.image.source https://github.com/cilium/ci-kernels
# Preserve the APT cache between runs
RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates
COPY llvm-snapshot.gpg /usr/share/keyrings
COPY llvm.list /etc/apt/sources.list.d
COPY llvm.pref /etc/apt/preferences.d
# Bake the appropriate clang version into the container
ARG CLANG_VERSION=16
ARG PAHOLE_VERSION=1.27
ENV CLANG=clang-${CLANG_VERSION}
ENV LLVM_STRIP=llvm-strip-${CLANG_VERSION}
ENV LLVM_DWARFDUMP=llvm-dwarfdump-${CLANG_VERSION}
# Update and install dependencies
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && \
apt-get install -y --no-install-recommends \
curl \
tar \
build-essential \
crossbuild-essential-amd64 \
crossbuild-essential-arm64 \
libncurses5-dev \
bison \
flex \
libssl-dev \
bc \
xz-utils \
ccache \
libelf-dev \
python3-docutils \
libcap-dev \
${CLANG} \
llvm-${CLANG_VERSION} \
lld \
kmod \
rsync \
libc6-dev-i386 \
cmake \
libdw-dev \
git
RUN cd /tmp && \
git clone https://git.kernel.org/pub/scm/devel/pahole/pahole.git && \
cd pahole && \
git checkout v${PAHOLE_VERSION} && \
git submodule update --init --recursive && \
mkdir build && \
cd build && \
cmake -D__LIB=lib -DBUILD_SHARED_LIBS=OFF .. && \
make install && \
cd / && \
rm -rf /tmp/pahole