-
Notifications
You must be signed in to change notification settings - Fork 12
/
Dockerfile
31 lines (26 loc) · 847 Bytes
/
Dockerfile
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
26
27
28
29
30
31
# Workaround for QEmu bug when building for 32bit platforms on a 64bit host
FROM --platform=$BUILDPLATFORM rust:bookworm as vendor
ARG BUILDPLATFORM
ARG TARGETPLATFORM
RUN echo "Running on: $BUILDPLATFORM / Building for $TARGETPLATFORM"
WORKDIR /app
COPY ./Cargo.toml .
COPY ./Cargo.lock .
COPY ./src src
RUN mkdir .cargo && cargo vendor > .cargo/config.toml
FROM rust:bookworm as builder
WORKDIR /app
COPY --from=vendor /app/.cargo .cargo
COPY --from=vendor /app/vendor vendor
COPY ./Cargo.toml .
COPY ./Cargo.lock .
COPY ./src src
RUN cargo build --release
FROM debian:bookworm-slim
WORKDIR /app
ENV RUST_BACKTRACE=full
COPY --from=builder /app/target/release/sio2prom sio2prom
COPY ./cfg cfg
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && update-ca-certificates
EXPOSE 8080
ENTRYPOINT ["/app/sio2prom"]