Test new caching mechanism
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Valentin Brandl 2019-09-16 22:42:41 +02:00
parent a85ff2a54b
commit bb5a3ecf4e
No known key found for this signature in database
GPG Key ID: 30D341DD34118D7D

View File

@ -26,17 +26,19 @@ COPY --chown=rust ./time-cache/Cargo.toml ./time-cache/Cargo.toml
WORKDIR /home/rust/src/yagcdn WORKDIR /home/rust/src/yagcdn
# build to cache dependencies # build to cache dependencies
RUN cargo build --release # RUN cargo build --release
# delete build cache to prevent caching issues later on # delete build cache to prevent caching issues later on
RUN rm -r ./target/x86_64-unknown-linux-musl/release/.fingerprint/yagcdn* # RUN rm -r ./target/x86_64-unknown-linux-musl/release/.fingerprint/yagcdn*
RUN rm -r ./target/x86_64-unknown-linux-musl/release/.fingerprint/time-cache-* # RUN rm -r ./target/x86_64-unknown-linux-musl/release/.fingerprint/time-cache-*
COPY ./backend/static ./static COPY ./backend/static ./static
COPY ./backend/src ./src COPY ./backend/src ./src
COPY ./time-cache/src ../time-cache/src COPY ./time-cache/src ../time-cache/src
# build source code # build source code
RUN cargo build --release
RUN --mount=type=cache,target=../../usr/local/cargo/registry \
--mount=type=cache,target=target \
cargo build --release
# create /etc/password for rootless scratch container # create /etc/password for rootless scratch container
FROM alpine:latest as user_builder FROM alpine:latest as user_builder