You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
468 B

FROM rust AS builder
WORKDIR /random
# Build dependencies
RUN echo "fn main() {}" >
COPY Cargo.toml .
RUN sed -i 's#src/' Cargo.toml
RUN cargo build --release
RUN sed -i '' Cargo.toml
# Prepare build
COPY src src
RUN touch src/
# Build release
RUN cargo build --release
# Run binary
FROM rust:slim
COPY --from=builder /random/target/release/random random
COPY static static
CMD ["./rust_talks"]