Skip to content

Commit

Permalink
chore: add distroless minimal base image (#13788)
Browse files Browse the repository at this point in the history
  • Loading branch information
MoeMahhouk authored Jan 15, 2025
1 parent 4b8714d commit f2bf024
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Dockerfile.reproducible
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ RUN apt-get update && apt-get install -y libclang-dev=1:11.0-51+nmu5
RUN git clone https://github.com/paradigmxyz/reth /app
WORKDIR /app

# Checkout the reproducible-build branch
RUN git checkout reproducible-build

# Get the latest commit timestamp and set SOURCE_DATE_EPOCH
RUN SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) && \
echo "SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH" >> /etc/environment
Expand All @@ -30,8 +27,10 @@ ARG FEATURES="jemalloc asm-keccak"
RUN . /etc/environment && \
cargo build --bin reth --features "${FEATURES}" --profile "reproducible" --locked --target x86_64-unknown-linux-gnu

# Create a minimal final image with just the binary
FROM scratch AS binaries
RUN . /etc/environment && mv /app/target/x86_64-unknown-linux-gnu/reproducible/reth /reth

# Copy the compiled binary from the builder stage
COPY --from=builder /app/target/x86_64-unknown-linux-gnu/reproducible/reth /reth
# Create a minimal final image with just the binary
FROM gcr.io/distroless/cc-debian12:nonroot-6755e21ccd99ddead6edc8106ba03888cbeed41a
COPY --from=builder /reth /reth
EXPOSE 30303 30303/udp 9001 8545 8546
ENTRYPOINT [ "/reth" ]

0 comments on commit f2bf024

Please sign in to comment.