Skip to content

Commit 5d152e8

Browse files
authored
feat: add build arg RBUILDER_BIN to dockerfile (#237)
## 📝 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)
1 parent 0a2e73e commit 5d152e8

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

Dockerfile

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \
4141
#
4242
FROM base as builder
4343
WORKDIR /app
44-
44+
# Default binary filename rbuilder
45+
# Alternatively can be set to "reth-rbuilder" - to have reth included in the binary
46+
ARG RBUILDER_BIN="rbuilder"
4547
COPY --from=planner /app/recipe.json recipe.json
4648

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

6062
#
6163
# Runtime container
6264
#
6365
FROM gcr.io/distroless/cc-debian12
64-
6566
WORKDIR /app
6667

67-
# RUN apk add libssl3 ca-certificates
68-
# RUN apt-get update \
69-
# && apt-get install -y libssl3 ca-certificates \
70-
# && rm -rf /var/lib/apt/lists/*
71-
72-
COPY --from=builder /app/target/release/rbuilder /app/rbuilder
68+
ARG RBUILDER_BIN="rbuilder"
69+
COPY --from=builder /app/target/release/${RBUILDER_BIN} /app/rbuilder
7370

7471
ENTRYPOINT ["/app/rbuilder"]

0 commit comments

Comments
 (0)