forked from linuxkit/linuxkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.perf
43 lines (38 loc) · 867 Bytes
/
Dockerfile.perf
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
# 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:3fdc49366257e53276c6f363956a4353f95d9a81 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