File: Dockerfile.alpine

package info (click to toggle)
bpftrace 0.25.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 7,580 kB
  • sloc: cpp: 68,194; ansic: 13,458; python: 971; yacc: 818; sh: 534; lex: 422; makefile: 22
file content (47 lines) | stat: -rw-r--r-- 1,213 bytes parent folder | download | duplicates (2)
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
44
45
46
47
# This Dockerfile is used to both document and test building bpftrace on the
# development version of Alpine. We attempt to catch bugs as early as possible
# which is why we are using the edge repository.

FROM alpine:edge

ARG LLVM_VERSION=20

RUN apk add --update \
  asciidoctor \
  bcc-dev \
  binutils-dev \
  bison \
  blazesym \
  build-base \
  cereal \
  clang$LLVM_VERSION-dev \
  clang$LLVM_VERSION-extra-tools \
  clang$LLVM_VERSION-static \
  cmake \
  elfutils-dev \
  flex-dev \
  libbpf-dev \
  linux-headers \
  llvm$LLVM_VERSION-dev \
  llvm$LLVM_VERSION-gtest \
  llvm$LLVM_VERSION-static \
  samurai \
  libxml2-dev

RUN ln -s "clang${LLVM_VERSION}" /usr/lib/cmake/clang

COPY . /src
WORKDIR /src

# We set USE_SYSTEM_LIBBPF=On to test that bpftrace can build with system libbpf
# (i.e. not using libbpf from the submodule)
RUN cmake -B /build -G Ninja \
  -DCMAKE_INSTALL_PREFIX=/usr \
  -DCMAKE_BUILD_TYPE=MinSizeRel \
  -DBUILD_TESTING=OFF \
  -DCMAKE_PREFIX_PATH=/usr/lib/llvm${LLVM_VERSION}/lib/cmake \
  -DLLVM_REQUESTED_VERSION="$(/usr/lib/llvm${LLVM_VERSION}/bin/llvm-config --version)" \
  -DUSE_SYSTEM_LIBBPF=1
RUN cmake --build /build -j$(nproc)

ENTRYPOINT ["/build/src/bpftrace"]