linuxkit/pkg/bpftrace/Dockerfile
Avi Deitcher ef3e45ac02 pkgs: Update packages to the latest linuxkit/alpine
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2021-04-28 09:13:18 +03:00

38 lines
989 B
Docker

FROM linuxkit/alpine:0c069d0fd7defddb6e03925fcd4915407db0c9e1 AS build
RUN apk add --update \
bison \
build-base \
clang-dev \
clang-static \
cmake \
elfutils-dev \
flex-dev \
git \
linux-headers \
llvm5-dev \
llvm5-static \
zlib-dev
# Put LLVM directories where CMake expects them to be
RUN ln -s /usr/lib/cmake/llvm5 /usr/lib/cmake/llvm
RUN ln -s /usr/include/llvm5/llvm /usr/include/llvm
RUN ln -s /usr/include/llvm5/llvm-c /usr/include/llvm-c
ENV GITREPO=https://github.com/iovisor/bpftrace.git
ENV COMMIT=8f7f8214d7dd7bc25b7740a3c0e9a580a89e0244
ENV STATIC_LINKING=on
ENV RUN_TESTS=0
RUN git clone ${GITREPO} /bpftrace \
&& cd /bpftrace/ \
&& mkdir -p /bpftrace/build \
&& git checkout ${COMMIT} \
&& chmod +x /bpftrace/docker/build.sh \
&& /bpftrace/docker/build.sh /bpftrace/build Release -j$(nproc)
FROM scratch
ENTRYPOINT []
CMD []
WORKDIR /
COPY --from=build /bpftrace/build/src/bpftrace /usr/bin/bpftrace