Skip to content

Commit 8bacc6b

Browse files
committed
Revert "Merge pull request #48 from mantle-xyz/fix/validity-dockerfile-cargo-chef-cache"
This reverts commit 3a4293a, reversing changes made to 3cb7101.
1 parent 3a4293a commit 8bacc6b

1 file changed

Lines changed: 7 additions & 22 deletions

File tree

validity/Dockerfile

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
1-
# Chef stage: shared base with cargo-chef installed
2-
FROM rust:1.85 AS chef
3-
RUN cargo install cargo-chef --locked
4-
WORKDIR /build
5-
6-
# Planner stage: compute a dependency-only recipe from the workspace
7-
# Cargo.toml/Cargo.lock, independent of the rest of the source tree
8-
FROM chef AS planner
9-
COPY . .
10-
RUN cargo chef prepare --recipe-path recipe.json
11-
121
# Build stage
13-
FROM chef AS builder
2+
FROM rust:1.85 AS builder
143

154
# Install build dependencies
165
RUN apt-get update && apt-get install -y \
@@ -28,25 +17,21 @@ RUN curl -LO https://go.dev/dl/go1.24.0.linux-amd64.tar.gz && \
2817
rm go1.24.0.linux-amd64.tar.gz
2918
ENV PATH="/usr/local/go/bin:${PATH}"
3019

20+
21+
WORKDIR /build
22+
3123
# Install SP1
3224
RUN curl -L https://sp1.succinct.xyz | bash && \
3325
~/.sp1/bin/sp1up -v 6.4.0 && \
3426
~/.sp1/bin/cargo-prove prove --version
3527

36-
# Build only the dependency graph first, keyed on the recipe (Cargo.toml/Cargo.lock)
37-
# rather than the full source tree. As long as dependency versions don't change,
38-
# this layer is reused from the registry build cache and the sp1-*/gnark crates
39-
# don't get recompiled on every source change.
40-
COPY --from=planner /build/recipe.json recipe.json
41-
RUN --mount=type=ssh \
42-
cargo chef cook --release --bin validity --bin clear-stuck-txs --recipe-path recipe.json
43-
4428
# Copy only what's needed for the build
4529
COPY . .
4630

47-
# Build the server. Dependencies are already compiled by the cook step above,
48-
# so this only (re)compiles the workspace's own crates that actually changed.
31+
# Build the server
4932
RUN --mount=type=ssh \
33+
--mount=type=cache,target=/root/.cargo/registry \
34+
--mount=type=cache,target=/build/target \
5035
cargo build --bin validity --bin clear-stuck-txs --release && \
5136
cp target/release/validity /build/validity-proposer && \
5237
cp target/release/clear-stuck-txs /build/clear-stuck-txs

0 commit comments

Comments
 (0)