Migrate to MUSL
This commit is contained in:
+17
-8
@@ -1,19 +1,28 @@
|
||||
FROM rust:latest AS builder
|
||||
# --- Builder stage ---
|
||||
FROM rust:1-bookworm AS builder
|
||||
|
||||
# Install musl target and musl-tools
|
||||
RUN rustup target add x86_64-unknown-linux-musl \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y musl-tools build-essential
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN cargo build --release
|
||||
# Build fully static binary
|
||||
RUN cargo build --release --target x86_64-unknown-linux-musl
|
||||
|
||||
# --- Final stage ---
|
||||
FROM debian:bookworm
|
||||
|
||||
COPY --from=builder /app/target/release/payphone /usr/local/bin/payphone
|
||||
# Copy static binary
|
||||
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/payphone /usr/local/bin/payphone
|
||||
|
||||
RUN apt-get update && apt-get install -y ca-certificates
|
||||
RUN update-ca-certificates
|
||||
RUN apt-get update && apt-get install -y ca-certificates \
|
||||
&& update-ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ENTRYPOINT [ "/usr/local/bin/payphone" ]
|
||||
CMD [ "start" ]
|
||||
ENTRYPOINT ["/usr/local/bin/payphone"]
|
||||
CMD ["start"]
|
||||
|
||||
Reference in New Issue
Block a user