m/cup
1
0
mirror of https://github.com/sergi0g/cup.git synced 2025-11-16 17:13:46 -05:00
Files
cup/Dockerfile
2024-07-11 12:27:02 +03:00

20 lines
421 B
Docker

FROM rust:alpine AS build
WORKDIR /
RUN apk add musl-dev
RUN USER=root cargo new --bin cup
WORKDIR /cup
COPY Cargo.toml Cargo.lock .
RUN cargo build --release
RUN rm -rf src/
COPY src src
# This is a very bad workaround, but cargo only triggers a rebuild this way for some reason
RUN printf "\n" >> src/main.rs
RUN cargo build --release
FROM scratch
COPY --from=build /cup/target/release/cup /cup
ENTRYPOINT ["/cup"]