Skip to content

Instantly share code, notes, and snippets.

@pwillis-els
Created January 7, 2021 00:31
Show Gist options
  • Save pwillis-els/08c1a25a58190106b0b931610f7cbee4 to your computer and use it in GitHub Desktop.
Save pwillis-els/08c1a25a58190106b0b931610f7cbee4 to your computer and use it in GitHub Desktop.
Dockerfile for building Rust applications with multi-stage builds
FROM rust as build
WORKDIR /build
COPY /src /build/src
COPY /man /build/man
COPY build.rs Cargo.toml /build/
RUN cargo build --release
FROM debian:buster-slim
#RUN apt update && apt install libraries && apt clean all
COPY --from=build /build/target/release/main /main
ENTRYPOINT ["/main"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment