docker: don't keep source or toolchain in container image

This commit is contained in:
2025-03-09 01:00:35 -08:00
parent 4a15e0b11a
commit d2ed54c377

View File

@ -1,8 +1,12 @@
FROM rust:1.85
FROM rust:1 AS builder
WORKDIR /usr/src/mqtt-exporter
COPY . .
COPY src/ ./src
COPY Cargo.* .
RUN cargo install --path .
RUN cargo install --path . --root /app
FROM debian:bookworm-slim
COPY --from=builder /app/bin/mqtt-exporter /usr/local/bin/mqtt-exporter
CMD ["mqtt-exporter"]