55# reth: --build-arg BINARY=reth
66# op-reth: --build-arg BINARY=op-reth --build-arg MANIFEST_PATH=crates/optimism/bin
77
8- FROM lukemathwalker/cargo-chef:latest- rust- 1 AS chef
8+ FROM rust: 1 AS builder
99WORKDIR /app
1010
1111LABEL org.opencontainers.image.source=https://github.com/paradigmxyz/reth
@@ -19,14 +19,6 @@ ENV RUSTC_WRAPPER=sccache
1919ENV SCCACHE_DIR=/sccache
2020ENV SCCACHE_WEBDAV_ENDPOINT=https://cache.depot.dev
2121
22- # Builds a cargo-chef plan
23- FROM chef AS planner
24- COPY --exclude=.git . .
25- RUN cargo chef prepare --recipe-path recipe.json
26-
27- FROM chef AS builder
28- COPY --from=planner /app/recipe.json recipe.json
29-
3022# Binary to build (reth or op-reth)
3123ARG BINARY=reth
3224
@@ -53,13 +45,6 @@ ENV VERGEN_GIT_SHA=$VERGEN_GIT_SHA
5345ENV VERGEN_GIT_DESCRIBE=$VERGEN_GIT_DESCRIBE
5446ENV VERGEN_GIT_DIRTY=$VERGEN_GIT_DIRTY
5547
56- # Build dependencies
57- RUN --mount=type=secret,id=DEPOT_TOKEN,env=SCCACHE_WEBDAV_TOKEN \
58- --mount=type=cache,target=/usr/local/cargo/registry,sharing=shared \
59- --mount=type=cache,target=/usr/local/cargo/git,sharing=shared \
60- --mount=type=cache,target=$SCCACHE_DIR,sharing=shared \
61- cargo chef cook --profile $BUILD_PROFILE --features "$FEATURES" --locked --recipe-path recipe.json --manifest-path $MANIFEST_PATH/Cargo.toml
62-
6348# Build application
6449COPY --exclude=.git . .
6550RUN --mount=type=secret,id=DEPOT_TOKEN,env=SCCACHE_WEBDAV_TOKEN \
0 commit comments