-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (16 loc) · 758 Bytes
/
Dockerfile
File metadata and controls
25 lines (16 loc) · 758 Bytes
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
FROM rust:latest AS bpfmeter-local-builder
RUN apt update && apt install -y pkg-config libfreetype-dev libfontconfig1-dev
RUN rustup toolchain install nightly --component rust-src
RUN cargo install bpf-linker bindgen-cli
RUN cargo install --git https://github.com/aya-rs/aya -- aya-tool
WORKDIR /bpfmeter
# Copy manifest and source
COPY Cargo.toml Cargo.lock ./
COPY bpfmeter ./bpfmeter
# Build the binary
RUN cargo build --release --no-default-features
FROM gcr.io/distroless/cc-debian12
COPY --from=bpfmeter-local-builder /bpfmeter/target/release/bpfmeter /usr/local/bin/
ENTRYPOINT [ "/usr/local/bin/bpfmeter" ]
# Run bpfmeter to export data in OpenMetrics format:
LABEL usage="docker run --rm -it -p 9100:9100 --privileged bpfmeter run -P 9100"