mirror of
https://codeberg.org/icewind/taspromto.git
synced 2026-06-03 16:44:11 +02:00
cache dependencies in docker build
This commit is contained in:
parent
104fb133b0
commit
777785ab76
1 changed files with 10 additions and 2 deletions
12
Dockerfile
12
Dockerfile
|
|
@ -1,7 +1,15 @@
|
|||
FROM ekidd/rust-musl-builder AS build
|
||||
|
||||
ADD . ./
|
||||
RUN sudo chown -R rust:rust .
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
|
||||
# Build with a dummy main to pre-build dependencies
|
||||
RUN mkdir src && \
|
||||
echo "fn main(){}" > src/main.rs && \
|
||||
cargo build --release && \
|
||||
rm -r src
|
||||
|
||||
COPY src/* ./src/
|
||||
RUN sudo chown -R rust:rust . && touch src/main.rs
|
||||
|
||||
RUN cargo build --release
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue