From 0fa6a2e4b248b4e028f97840a691e1d51294538f Mon Sep 17 00:00:00 2001 From: prplV Date: Tue, 18 Feb 2025 16:07:11 +0300 Subject: [PATCH] dockerfile fixed --- Dockerfile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8d003bd..f40ec48 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,17 @@ -FROM rust:1.75 AS builder - +FROM rust:1.84 AS builder WORKDIR /app +RUN apt update && apt install -y musl-tools +RUN rustup target add x86_64-unknown-linux-musl + COPY . . +RUN cargo build --release --target=x86_64-unknown-linux-musl -RUN cargo build --release - -FROM debian:bullseye-slim - +FROM alpine:latest WORKDIR /app -# RUN sudo apt update -# RUN sudo apt install libc6 -COPY --from=builder /app/target/release/exporter /app/server + +COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/exporter /app/exporter +RUN apk add --no-cache ca-certificates EXPOSE 9100 -CMD ["/app/server"] +CMD ["/app/exporter"]