sizes: https://twitter.com/yslanramosdev/status/1544923205323874304
Created
July 7, 2022 05:59
-
-
Save Tsugami/dae286b4391cb83bae45682449d28e3f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM rust:slim-buster as builder | |
WORKDIR /code | |
RUN rustup target add x86_64-unknown-linux-musl | |
RUN apt update && apt install -y musl-tools musl-dev | |
RUN update-ca-certificates | |
RUN user=root cargo init | |
COPY Cargo.toml Cargo.toml | |
RUN cargo fetch | |
COPY src src | |
RUN cargo build --target x86_64-unknown-linux-musl --release | |
FROM scratch | |
WORKDIR /app | |
COPY --from=builder /code/target/x86_64-unknown-linux-musl/release/mirim mirim | |
USER 666 | |
EXPOSE 8080 | |
CMD ["/app/mirim"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM rust:1.62 as builder | |
WORKDIR /app | |
COPY . . | |
RUN cargo build --release | |
FROM debian:bullseye-slim as runtime | |
COPY --from=builder /app/target/release/mirim /mirim | |
ENTRYPOINT ["/mirim"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment