From b8cfc48b8ec6bec02351223cae9c395cef67d668 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Wed, 03 Aug 2022 15:03:55 +0000 Subject: [PATCH] SpeedUp build by adding cargo-chef into Dockerfile. --- --- a/.docker/Dockerfile-parachain +++ b/.docker/Dockerfile-parachain @@ -16,7 +16,9 @@ RUN apt-get update && \ apt-get dist-upgrade -y -o Dpkg::Options::="--force-confold" && \ - apt-get install -y cmake pkg-config libssl-dev git clang + apt-get install -y cmake pkg-config libssl-dev git clang && \ + apt-get clean && \ + rm -r /var/lib/apt/lists/* RUN rustup toolchain uninstall $(rustup toolchain list) && \ rustup toolchain install $RUST_TOOLCHAIN && \ @@ -25,6 +27,18 @@ rustup show RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN + +RUN cargo install cargo-chef + +RUN mkdir unique_parachain +WORKDIR /unique_parachain + +# ===== Chef ===== +FROM rust-builder as chef + +COPY . . +RUN cargo chef prepare --recipe-path recipe.json + ####works inside repo folder### @@ -34,6 +48,10 @@ RUN mkdir unique_parachain WORKDIR /unique_parachain +COPY --from=chef /unique_parachain/recipe.json recipe.json + +RUN cargo chef cook --release --recipe-path recipe.json + ARG FEATURE=' ' COPY . . -- gitstuff