Improve Docker image size
This commit is contained in:
parent
6c654072a5
commit
08d9017c8e
2 changed files with 6 additions and 4 deletions
|
|
@ -1,3 +1,4 @@
|
|||
.github/
|
||||
credentials/
|
||||
target/
|
||||
Dockerfile
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
FROM rust:1.81.0-alpine3.20 AS builder
|
||||
RUN apk add --no-cache musl-dev libressl-dev
|
||||
WORKDIR /usr/src/app
|
||||
COPY . .
|
||||
COPY Cargo.lock Cargo.toml .
|
||||
COPY src ./src
|
||||
RUN cargo build --release
|
||||
|
||||
FROM alpine:3.20
|
||||
COPY --from=builder /usr/src/app/target/release/auth_ssh_games /usr/local/bin/auth_ssh_games
|
||||
ENTRYPOINT [ "auth_ssh_games" ]
|
||||
FROM scratch
|
||||
COPY --from=builder /usr/src/app/target/release/auth_ssh_games /auth_ssh_games
|
||||
ENTRYPOINT [ "/auth_ssh_games" ]
|
||||
Loading…
Add table
Add a link
Reference in a new issue