Merge pull request #598 from vbrandl/fix/docker-build
All checks were successful
continuous-integration/drone/push Build is passing

Fix docker build with moved `build.rs` script
This commit is contained in:
Valentin Brandl 2023-04-13 13:09:08 +02:00 committed by GitHub
commit 88eab864b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,7 +10,7 @@ RUN echo 'fn main() { println!("Hello, world!"); }' >> src/main.rs
COPY ./Cargo.lock ./Cargo.lock COPY ./Cargo.lock ./Cargo.lock
COPY ./Cargo.toml ./Cargo.toml COPY ./Cargo.toml ./Cargo.toml
# HACK: remove build-dependencies so we have at least some caching # HACK: remove build-dependencies so we have at least some caching
RUN head -n $(($(grep -n "\[build-dependencies\]" Cargo.toml | cut -f1 -d:) - 1)) Cargo.toml | sed '/build.rs/d' > \ RUN head -n $(($(grep -n "\[build-dependencies\]" Cargo.toml | cut -f1 -d:) - 1)) Cargo.toml | sed '/src\/build.rs/d' > \
Cargo.toml2 && rm Cargo.toml && mv Cargo.toml2 Cargo.toml Cargo.toml2 && rm Cargo.toml && mv Cargo.toml2 Cargo.toml
# build to cache dependencies # build to cache dependencies
RUN cargo build --release RUN cargo build --release
@ -24,7 +24,6 @@ COPY ./.git ./.git
# copy source code # copy source code
COPY ./static ./static COPY ./static ./static
COPY ./templates ./templates COPY ./templates ./templates
COPY ./build.rs ./build.rs
COPY ./src ./src COPY ./src ./src
# build source code # build source code
RUN cargo build --release RUN cargo build --release