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.45-alpine as builder | |
WORKDIR /usr/src/app | |
RUN apk add --no-cache musl-dev | |
RUN USER="builder" cargo init | |
COPY Cargo.toml . | |
COPY Cargo.lock . | |
RUN mkdir .cargo && cargo vendor > .cargo/config | |
RUN cargo build --release --color always 2>&1 | |
COPY ./src src | |
RUN touch src/main.rs && cargo build --release --color always 2>&1 |