uso do caché no dockerfile

This commit is contained in:
serxoz 2023-03-16 11:35:13 +01:00
parent 47de0590e7
commit cbe5616c9f

View File

@ -11,7 +11,10 @@ RUN rustup target add "$TARGET"
RUN USER=root mkdir ./itkg
WORKDIR ./itkg
ADD . ./
RUN cargo build --release --locked --target "$TARGET" \
# caché: xenera unha capa de docker para os sucesivos builds
RUN --mount=type=cache,target=/usr/local/cargo/registry \
cargo build --release --locked --target "$TARGET" \
&& mv "target/$TARGET/release/itkg" . \
&& strip itkg