Created
October 21, 2021 06:12
-
-
Save botdad/288563437f063b993c3acded0056f570 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 as builder | |
WORKDIR /usr/src/power-clash/ | |
COPY Cargo.toml . | |
COPY Cargo.lock . | |
# This is a dummy build to get the dependencies cached. | |
RUN mkdir src \ | |
&& echo "fn main() {}" > src/main.rs \ | |
&& cargo build --release | |
COPY . . | |
RUN touch src/main.rs | |
# The real build | |
RUN cargo build --release | |
FROM rust:slim as runtime | |
COPY --from=builder /usr/src/power-clash/target/release/power-clash /usr/local/bin/power-clash | |
ENTRYPOINT ["/usr/local/bin/power-clash"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment