From dd455d3a41910097d6d32853ce42f9de1d198ebe Mon Sep 17 00:00:00 2001 From: Fuyao Zhao Date: Thu, 21 Aug 2025 12:00:31 +0800 Subject: [PATCH 1/2] add docker file --- Dockerfile | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..d415ae568 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,56 @@ +# syntax=docker.io/docker/dockerfile:1.7-labs + +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 + +# Builds a cargo-chef plan +FROM chef AS planner +COPY --exclude=.git --exclude=dist . . +RUN cargo chef prepare --recipe-path recipe.json + +FROM chef AS builder +COPY --from=planner /app/recipe.json recipe.json + +# Build profile, release by default +ARG BUILD_PROFILE=release +ENV BUILD_PROFILE=$BUILD_PROFILE + +# Extra Cargo flags +ARG RUSTFLAGS="" +ENV RUSTFLAGS="$RUSTFLAGS" + +# Extra Cargo features +ARG FEATURES="" +ENV FEATURES=$FEATURES + +# Builds dependencies +RUN cargo chef cook --profile $BUILD_PROFILE --features "$FEATURES" --recipe-path recipe.json + +# Build application +COPY --exclude=dist . . +RUN cargo build --profile $BUILD_PROFILE --features "$FEATURES" --locked --bin reth-hl + +# ARG is not resolved in COPY so we have to hack around it by copying the +# binary to a temporary location +RUN cp /app/target/$BUILD_PROFILE/reth-hl /app/reth-hl + +# Use Ubuntu as the release image +FROM ubuntu AS runtime +WORKDIR /app + +# Install root certificates for aws sdk to work +RUN apt-get update && apt-get install -y ca-certificates && update-ca-certificates + +# Copy reth over from the build stage +COPY --from=builder /app/reth-hl /usr/local/bin + +# Copy licenses +COPY LICENSE-* ./ + +EXPOSE 30303 30303/udp 9001 8545 8546 +ENTRYPOINT ["/usr/local/bin/reth-hl"] \ No newline at end of file From 78b9028ded9b5c2394f4e59cf728a76d4326c860 Mon Sep 17 00:00:00 2001 From: Fuyao Zhao Date: Fri, 22 Aug 2025 07:57:47 +0800 Subject: [PATCH 2/2] . --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d415ae568..059b6111f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ 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.source=https://github.com/hl-archive-node/nanoreth LABEL org.opencontainers.image.licenses="MIT OR Apache-2.0" # Install system dependencies @@ -52,5 +52,5 @@ COPY --from=builder /app/reth-hl /usr/local/bin # Copy licenses COPY LICENSE-* ./ -EXPOSE 30303 30303/udp 9001 8545 8546 +EXPOSE 9001 8545 8546 ENTRYPOINT ["/usr/local/bin/reth-hl"] \ No newline at end of file