From 3fff79a2cda126843454daeb2e4fa44a92233030 Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Wed, 22 Mar 2023 15:27:10 +0100 Subject: [PATCH] Fix missing build script/git repo during build When building the dependencies, the build script should not be considered. When building the actual binary, the git repository needs to be present and the build script should be run. --- .dockerignore | 3 --- Dockerfile | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.dockerignore b/.dockerignore index e183625..9634662 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,9 +5,6 @@ target Dockerfile* docker-compose* -# Git folder -.git - # Dot files .gitignore diff --git a/Dockerfile b/Dockerfile index 4ef31ed..02185a4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,10 +11,12 @@ ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse RUN USER=root cargo new --bin /usr/src/solar-grabber WORKDIR /usr/src/solar-grabber COPY ./Cargo.* ./ +RUN sed -i -e 's/^build =/#build =/' Cargo.toml RUN cargo build --release RUN rm src/*.rs # Add the real project files from current folder +COPY ./Cargo.toml ./ ADD . ./ # Build the actual binary from the copied local files