mirror of
https://codeberg.org/demostf/sync.git
synced 2026-06-03 16:44:07 +02:00
prebuild dependencies in docker
This commit is contained in:
parent
55e4b34ea1
commit
7e2058fa5c
1 changed files with 11 additions and 4 deletions
15
Dockerfile
15
Dockerfile
|
|
@ -1,9 +1,16 @@
|
|||
FROM ekidd/rust-musl-builder AS build
|
||||
|
||||
# We need to add the source code to the image because `rust-musl-builder`
|
||||
# assumes a UID of 1000, but TravisCI has switched to 2000.
|
||||
ADD . ./
|
||||
RUN sudo chown -R rust:rust .
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
|
||||
# Build with a dummy main to pre-build dependencies
|
||||
RUN mkdir src && \
|
||||
sudo chown -R rust:rust . && \
|
||||
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