FROM rust:1.95-bookworm AS build
WORKDIR /work
COPY Cargo.toml Cargo.lock ./
COPY src ./src
COPY examples ./examples
COPY configs ./configs
COPY experiments/private-threads/Cargo.toml experiments/private-threads/Cargo.lock ./experiments/private-threads/
COPY experiments/nat-transport/Cargo.toml ./experiments/nat-transport/
COPY experiments/nat-transport/src ./experiments/nat-transport/src
COPY experiments/private-threads/src ./experiments/private-threads/src
ARG THREAD_FEATURES=http
RUN cargo test --manifest-path experiments/private-threads/Cargo.toml --locked --features ${THREAD_FEATURES} && cargo build --manifest-path experiments/private-threads/Cargo.toml --locked --release --features ${THREAD_FEATURES}
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates && rm -rf /var/lib/apt/lists/*
COPY --from=build /work/experiments/private-threads/target/release/skein-private-thread-spike /usr/local/bin/skein-private-thread-spike
USER 65534:65534
ENTRYPOINT ["/usr/local/bin/skein-private-thread-spike"]
