Files
linuxkit/kernel/common/Dockerfile.perf
Chris Irrgang 50025b8840 separate kernel series hashing (#4194)
* separate kernel series hashing

Signed-off-by: Chris Irrgang <chris.irrgang@gmx.de>

* fix issues with the update component sha script

- add bsd/gnu cross compatibility for sed
- also replace in */test.sh files
- replace potentially problematic xargs
- remove potentially problematic word boundary \b

Signed-off-by: Chris Irrgang <chris.irrgang@gmx.de>

* Move common kernel files to dedicated folder

Signed-off-by: Chris Irrgang <chris.irrgang@gmx.de>

* run update-kernel-yamls

Signed-off-by: Chris Irrgang <chris.irrgang@gmx.de>

---------

Signed-off-by: Chris Irrgang <chris.irrgang@gmx.de>
2025-12-11 21:06:47 +02:00

65 lines
1.3 KiB
Docker

# This Dockerfile extracts the source code and headers from a kernel package,
# builds the perf utility, and places it into a scratch image
ARG BUILD_IMAGE
ARG KERNEL_VERSION
ARG PKG_HASH
FROM linuxkit/kernel:${KERNEL_VERSION}-${PKG_HASH} as ksrc
FROM ${BUILD_IMAGE} AS build
RUN apk add \
argp-standalone \
bash \
bc \
binutils-dev \
bison \
build-base \
diffutils \
flex \
git \
gmp-dev \
installkernel \
kmod \
elfutils-dev \
findutils \
libelf-static \
mpc1-dev \
mpfr-dev \
python3 \
python3-dev \
sed \
tar \
xz \
xz-dev \
zlib-dev \
zlib-static \
zstd \
zstd-static
COPY --from=ksrc /linux.tar.xz /kernel-headers.tar /
RUN tar xf linux.tar.xz && \
tar xf kernel-headers.tar
# download and build libtraceevent.a
WORKDIR /build
ENV LIBTRACE_COMMIT=libtraceevent-1.8.2
RUN git clone https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git && \
cd libtraceevent && \
git checkout $LIBTRACE_COMMIT
RUN make -C libtraceevent all install V=1
WORKDIR /linux
RUN mkdir -p /out && \
make -C tools/perf EXTRA_CFLAGS="-Wno-alloc-size -Wno-calloc-transposed-args" LDFLAGS=-static V=1 && \
strip tools/perf/perf && \
cp tools/perf/perf /out
FROM scratch
ENTRYPOINT []
CMD []
WORKDIR /
COPY --from=build /out/perf /usr/bin/perf