mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Correct Dockerfile caching
This commit is contained in:
@@ -19,7 +19,9 @@ WORKDIR /serai
|
|||||||
RUN apt update && apt install -y clang
|
RUN apt update && apt install -y clang
|
||||||
|
|
||||||
# Mount the caches and build
|
# Mount the caches and build
|
||||||
RUN --mount=type=cache,target=/root/.cargo/ \
|
RUN --mount=type=cache,target=/root/.cargo \
|
||||||
|
--mount=type=cache,target=/usr/local/cargo/registry \
|
||||||
|
--mount=type=cache,target=/usr/local/cargo/git \
|
||||||
--mount=type=cache,target=/serai/target \
|
--mount=type=cache,target=/serai/target \
|
||||||
cd message-queue && \
|
cd message-queue && \
|
||||||
cargo build --release --all-features && \
|
cargo build --release --all-features && \
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ ADD AGPL-3.0 /serai
|
|||||||
WORKDIR /serai
|
WORKDIR /serai
|
||||||
|
|
||||||
# Mount the caches and build
|
# Mount the caches and build
|
||||||
RUN --mount=type=cache,target=/root/.cargo/ \
|
RUN --mount=type=cache,target=/root/.cargo \
|
||||||
|
--mount=type=cache,target=/usr/local/cargo/registry \
|
||||||
|
--mount=type=cache,target=/usr/local/cargo/git \
|
||||||
--mount=type=cache,target=/serai/target \
|
--mount=type=cache,target=/serai/target \
|
||||||
cd processor && \
|
cd processor && \
|
||||||
cargo build --release --all-features && \
|
cargo build --release --all-features && \
|
||||||
|
|||||||
@@ -20,31 +20,26 @@ WORKDIR /serai
|
|||||||
RUN rustup update
|
RUN rustup update
|
||||||
|
|
||||||
# Install Solc @ 0.8.16
|
# Install Solc @ 0.8.16
|
||||||
RUN --mount=type=cache,target=/root/.cache/ \
|
RUN --mount=type=cache,target=/root/.cache \
|
||||||
--mount=type=cache,target=/root/.local/ \
|
--mount=type=cache,target=/root/.local \
|
||||||
--mount=type=cache,target=/root/.solc-select \
|
--mount=type=cache,target=/root/.solc-select \
|
||||||
pip3 install solc-select==0.2.1
|
pip3 install solc-select==0.2.1
|
||||||
RUN --mount=type=cache,target=/root/.cache/ \
|
RUN --mount=type=cache,target=/root/.cache \
|
||||||
--mount=type=cache,target=/root/.local/ \
|
--mount=type=cache,target=/root/.local \
|
||||||
--mount=type=cache,target=/root/.solc-select \
|
--mount=type=cache,target=/root/.solc-select \
|
||||||
solc-select install 0.8.16
|
solc-select install 0.8.16
|
||||||
RUN --mount=type=cache,target=/root/.cache/ \
|
RUN --mount=type=cache,target=/root/.cache \
|
||||||
--mount=type=cache,target=/root/.local/ \
|
--mount=type=cache,target=/root/.local \
|
||||||
--mount=type=cache,target=/root/.solc-select \
|
--mount=type=cache,target=/root/.solc-select \
|
||||||
solc-select use 0.8.16
|
solc-select use 0.8.16
|
||||||
|
|
||||||
# Mount cargo and the Serai cache
|
# Mount cargo and the Serai cache
|
||||||
RUN --mount=type=cache,target=/root/.local/ \
|
RUN --mount=type=cache,target=/root/.local \
|
||||||
--mount=type=cache,target=/root/.solc-select \
|
--mount=type=cache,target=/root/.solc-select \
|
||||||
--mount=type=cache,target=/root/.cache/ \
|
--mount=type=cache,target=/root/.cache \
|
||||||
--mount=type=cache,target=/usr/local/cargo/git \
|
--mount=type=cache,target=/usr/local/cargo/git \
|
||||||
--mount=type=cache,target=/usr/local/cargo/registry \
|
--mount=type=cache,target=/usr/local/cargo/registry \
|
||||||
--mount=type=cache,target=/serai/target/release/build \
|
--mount=type=cache,target=/serai/target \
|
||||||
--mount=type=cache,target=/serai/target/release/deps \
|
|
||||||
--mount=type=cache,target=/serai/target/release/.fingerprint \
|
|
||||||
--mount=type=cache,target=/serai/target/release/incremental \
|
|
||||||
--mount=type=cache,target=/serai/target/release/wbuild \
|
|
||||||
--mount=type=cache,target=/serai/target/release/lib* \
|
|
||||||
cd substrate/node && cargo build --release
|
cd substrate/node && cargo build --release
|
||||||
|
|
||||||
# Prepare Image
|
# Prepare Image
|
||||||
|
|||||||
Reference in New Issue
Block a user