The edge Dockerfile copied Cargo.toml but not benches/, so cargo refused to parse the manifest over the declared [[bench]] hot_paths target and the image build died with exit 101 before compiling anything. Also bump checkout/buildx/build-push to their node24 majors and pin ubuntu-24.04 to clear the runner deprecation notices.
30 lines
1.1 KiB
Text
30 lines
1.1 KiB
Text
FROM rust:slim-bookworm AS builder
|
|
|
|
RUN apt-get update && apt-get install -y pkg-config libssl-dev clang libelf-dev libbpf-dev linux-libc-dev make gcc && rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
COPY Cargo.toml Cargo.lock rustfmt.toml clippy.toml deny.toml build.rs ./
|
|
COPY src/ ./src/
|
|
COPY xdp/ ./xdp/
|
|
# Cargo.toml declares `[[bench]] hot_paths`; the manifest does not parse unless
|
|
# the target file exists, even though the image only builds the `rampart` bin.
|
|
COPY benches/ ./benches/
|
|
|
|
# Smoke-check: the BPF program compiles with clang (build only, never loaded).
|
|
RUN if command -v clang >/dev/null; then \
|
|
mkdir -p /app/target/xdp && \
|
|
clang -O2 -g -target bpf -I"/usr/include/$(gcc -print-multiarch)" -c xdp/core/universal_filter.c -o /app/target/xdp/universal_filter.o; \
|
|
fi
|
|
|
|
RUN cargo build --release --features xdp,protocol-minecraft --bin rampart && \
|
|
cp target/release/rampart /app/rampart && \
|
|
strip /app/rampart
|
|
|
|
FROM debian:bookworm-slim
|
|
RUN apt-get update && apt-get install -y ca-certificates libelf1 && rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY --from=builder /app/rampart /usr/local/bin/rampart
|
|
|
|
EXPOSE 25565 9090
|
|
|
|
ENTRYPOINT ["rampart"]
|