mirror of
https://codeberg.org/demostf/sync.git
synced 2026-06-04 00:54:08 +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
|
FROM ekidd/rust-musl-builder AS build
|
||||||
|
|
||||||
# We need to add the source code to the image because `rust-musl-builder`
|
COPY Cargo.toml Cargo.lock ./
|
||||||
# assumes a UID of 1000, but TravisCI has switched to 2000.
|
|
||||||
ADD . ./
|
# Build with a dummy main to pre-build dependencies
|
||||||
RUN sudo chown -R rust:rust .
|
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
|
RUN cargo build --release
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue