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.
This commit is contained in:
parent
9200a10cef
commit
3fff79a2cd
|
@ -5,9 +5,6 @@ target
|
|||
Dockerfile*
|
||||
docker-compose*
|
||||
|
||||
# Git folder
|
||||
.git
|
||||
|
||||
# Dot files
|
||||
.gitignore
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue