From bee808e577750633a97faabfe9139b709a7b822a Mon Sep 17 00:00:00 2001 From: Sergio <77530549+sergi0g@users.noreply.github.com> Date: Thu, 11 Jul 2024 12:27:02 +0300 Subject: [PATCH] FINALLY fix Dockerfile --- Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 23ef05a..c47cd04 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,11 +6,13 @@ RUN apk add musl-dev RUN USER=root cargo new --bin cup WORKDIR /cup -COPY Cargo.toml Cargo.lock ./ +COPY Cargo.toml Cargo.lock . RUN cargo build --release -RUN rm src/*.rs +RUN rm -rf src/ -COPY src ./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