mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-26 20:18:52 +00:00
alpine: add Makefile/Dockerfile to build the Linux perf
utility
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
parent
2cb9fc5223
commit
e72977308c
1
alpine/base/perf/.gitignore
vendored
Normal file
1
alpine/base/perf/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/bin
|
17
alpine/base/perf/Dockerfile
Normal file
17
alpine/base/perf/Dockerfile
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# Tag: 3da0b0ea0da2724232603094e67c75b41adab551
|
||||||
|
FROM mobylinux/alpine-build-c@sha256:0236d6599f6c8f7aa42829285e04202fbe99984df2818af0f5a453a59de8b090
|
||||||
|
|
||||||
|
ARG KERNEL_VERSION=4.8.14
|
||||||
|
|
||||||
|
# get kernel source and extract it under /linux
|
||||||
|
ENV KERNEL_SOURCE=https://www.kernel.org/pub/linux/kernel/v4.x/linux-${KERNEL_VERSION}.tar.xz
|
||||||
|
RUN curl -fsSL -o linux-${KERNEL_VERSION}.tar.xz ${KERNEL_SOURCE}
|
||||||
|
RUN cat linux-${KERNEL_VERSION}.tar.xz | tar --absolute-names -xJ && mv /linux-${KERNEL_VERSION} /linux
|
||||||
|
|
||||||
|
RUN mkdir -p /build/perf && \
|
||||||
|
make -C /linux/tools/perf O=/build/perf LDFLAGS=-static
|
||||||
|
|
||||||
|
WORKDIR /build/perf
|
||||||
|
CMD ["tar", "cf", "-", "perf"]
|
||||||
|
|
||||||
|
|
9
alpine/base/perf/Makefile
Normal file
9
alpine/base/perf/Makefile
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
DEPS=Dockerfile
|
||||||
|
|
||||||
|
bin/perf: $(DEPS)
|
||||||
|
mkdir -p bin
|
||||||
|
BUILD=$$( docker build -q . ) && \
|
||||||
|
docker run --rm --net=none $$BUILD | tar xf - -C bin
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf bin
|
1
alpine/base/perf/README.md
Normal file
1
alpine/base/perf/README.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
Builds a statically linked version of the Linux kernel `perf` utility. You may want to/need to adjust the kernel version in the `Dockerfile` to match your kernel.
|
Loading…
Reference in New Issue
Block a user