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