Improve Docker image size

This commit is contained in:
Bad Manners 2024-12-21 10:14:59 -03:00
parent 6c654072a5
commit 08d9017c8e
2 changed files with 6 additions and 4 deletions

View file

@ -1,3 +1,4 @@
.github/ .github/
credentials/ credentials/
target/ target/
Dockerfile

View file

@ -1,9 +1,10 @@
FROM rust:1.81.0-alpine3.20 AS builder FROM rust:1.81.0-alpine3.20 AS builder
RUN apk add --no-cache musl-dev libressl-dev RUN apk add --no-cache musl-dev libressl-dev
WORKDIR /usr/src/app WORKDIR /usr/src/app
COPY . . COPY Cargo.lock Cargo.toml .
COPY src ./src
RUN cargo build --release RUN cargo build --release
FROM alpine:3.20 FROM scratch
COPY --from=builder /usr/src/app/target/release/auth_ssh_games /usr/local/bin/auth_ssh_games COPY --from=builder /usr/src/app/target/release/auth_ssh_games /auth_ssh_games
ENTRYPOINT [ "auth_ssh_games" ] ENTRYPOINT [ "/auth_ssh_games" ]