snapkitty
cryptography
python
marlborg-worm / deploy /Dockerfile
SNAPKITTYWEST's picture
push from SNAPKITTYWEST/marlborg-worm
75619b0 verified
Raw History Blame Contribute Delete
722 Bytes
# Stage 1: Deterministic Build Environment
FROM rust:1.80-alpine AS builder
RUN apk add --no-cache musl-dev
WORKDIR /usr/src/marlborg-monitor
COPY Cargo.toml Cargo.lock ./
RUN mkdir src && echo "fn main() {}" > src/main.rs && \
cargo build --release --target=x86_64-unknown-linux-musl && \
rm -rf src
COPY src ./src
RUN RUSTFLAGS='-C target-feature=+crt-static -C strip=symbols' \
cargo build --release --target=x86_64-unknown-linux-musl
# Stage 2: Minimal Execution Environment (Zero-OS footprint)
FROM scratch
COPY --from=builder /usr/src/marlborg-monitor/target/x86_64-unknown-linux-musl/release/strain_monitor /strain_monitor
USER 10000:10000
ENTRYPOINT ["/strain_monitor"]