Skip to content

Commit

Permalink
feat: add build arg RBUILDER_BIN to dockerfile (flashbots#237)
Browse files Browse the repository at this point in the history
## 📝 Summary

Adds `RBUILDER_BIN` build arg to Dockerfile so that a docker image for `reth-rbuilder` can be built as well.

## 💡 Motivation and Context

<!--- (Optional) Why is this change required? What problem does it
solve? Remove this section if not applicable. -->

---

## ✅ I have completed the following steps:

* [ ] Run `make lint`
* [ ] Run `make test`
* [ ] Added tests (if applicable)
  • Loading branch information
barnabasbusa authored Nov 5, 2024
1 parent 0a2e73e commit 5d152e8
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \
#
FROM base as builder
WORKDIR /app

# Default binary filename rbuilder
# Alternatively can be set to "reth-rbuilder" - to have reth included in the binary
ARG RBUILDER_BIN="rbuilder"
COPY --from=planner /app/recipe.json recipe.json

RUN --mount=type=cache,target=$SCCACHE_DIR,sharing=locked \
Expand All @@ -55,20 +57,15 @@ COPY ./crates/ ./crates/
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=$SCCACHE_DIR,sharing=locked \
cargo build --release --features="$FEATURES"
cargo build --release --features="$FEATURES" --bin=${RBUILDER_BIN}

#
# Runtime container
#
FROM gcr.io/distroless/cc-debian12

WORKDIR /app

# RUN apk add libssl3 ca-certificates
# RUN apt-get update \
# && apt-get install -y libssl3 ca-certificates \
# && rm -rf /var/lib/apt/lists/*

COPY --from=builder /app/target/release/rbuilder /app/rbuilder
ARG RBUILDER_BIN="rbuilder"
COPY --from=builder /app/target/release/${RBUILDER_BIN} /app/rbuilder

ENTRYPOINT ["/app/rbuilder"]

0 comments on commit 5d152e8

Please sign in to comment.