Files
linuxkit/kernel/Dockerfile.perf
Rolf Neugebauer 250b14661b kernel: Use elfutils-dev instead of libelf-dev
With kernel 5.0.6 we start seeing compile errors such as:

  HOSTCXX -fPIC scripts/gcc-plugins/randomize_layout_plugin.o
In file included from <stdin>:1:
/usr/include/libelf/libelf.h:28:5: error: "__LIBELF_INTERNAL__" is not defined, evaluates to 0 [-Werror=undef]
 #if __LIBELF_INTERNAL__
     ^~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

elutils-dev installs a different version of libelf.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-04-05 19:01:51 +01:00

44 lines
867 B
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 IMAGE
FROM ${IMAGE} AS ksrc
FROM linuxkit/alpine:518c2ed0f398c5508969ac5e033607201fb419ed AS build
RUN apk add \
argp-standalone \
bash \
bc \
binutils-dev \
bison \
build-base \
diffutils \
flex \
gmp-dev \
installkernel \
kmod \
elfutils-dev \
mpc1-dev \
mpfr-dev \
sed \
tar \
xz \
xz-dev \
zlib-dev
COPY --from=ksrc /linux.tar.xz /kernel-headers.tar /
RUN tar xf linux.tar.xz && \
tar xf kernel-headers.tar
WORKDIR /linux
RUN mkdir -p /out && \
make -C tools/perf LDFLAGS=-static && \
strip tools/perf/perf && \
cp tools/perf/perf /out
FROM scratch
ENTRYPOINT []
CMD []
WORKDIR /
COPY --from=build /out/perf /usr/bin/perf