From d35594b214862a18ab37d73d8d1816b4943ac1de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keszey=20D=C3=A1niel?= Date: Mon, 2 Sep 2024 11:17:19 +0200 Subject: [PATCH] add rbuilder to EL dockerfile --- Dockerfile | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1dc54909ff9b..21f9fb2ec0fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,10 @@ FROM lukemathwalker/cargo-chef:latest-rust-1 AS chef WORKDIR /app - LABEL org.opencontainers.image.source=https://github.com/paradigmxyz/reth LABEL org.opencontainers.image.licenses="MIT OR Apache-2.0" # Install system dependencies -RUN apt-get update && apt-get -y upgrade && apt-get install -y libclang-dev pkg-config +RUN apt-get update && apt-get -y upgrade && apt-get install -y libclang-dev pkg-config git # Builds a cargo-chef plan FROM chef AS planner @@ -34,19 +33,32 @@ RUN cargo chef cook --profile $BUILD_PROFILE --features "$FEATURES" --recipe-pat COPY . . RUN cargo build --profile $BUILD_PROFILE --features "$FEATURES" --locked --bin reth -# ARG is not resolved in COPY so we have to hack around it by copying the -# binary to a temporary location +# Clone and build rbuilder +RUN git clone https://github.com/taikoxyz/rbuilder.git /app/rbuilder +WORKDIR /app/rbuilder +RUN cargo build --release + +# Copy binaries to a temporary location RUN cp /app/target/$BUILD_PROFILE/reth /app/reth +RUN cp /app/rbuilder/target/release/rbuilder /app/rbuilder # Use Ubuntu as the release image FROM ubuntu AS runtime WORKDIR /app -# Copy reth over from the build stage +# Install necessary runtime dependencies +RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/* + +# Copy reth and rbuilder over from the build stage COPY --from=builder /app/reth /usr/local/bin +COPY --from=builder /app/rbuilder /usr/local/bin + +# Copy the entire rbuilder repository +COPY --from=builder /app/rbuilder /app/rbuilder # Copy licenses COPY LICENSE-* ./ EXPOSE 30303 30303/udp 9001 8545 8546 + ENTRYPOINT ["/usr/local/bin/reth"]