Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ RUN cp /app/target/$BUILD_PROFILE/ev-reth /ev-reth
FROM ubuntu:24.04 AS runtime

RUN apt-get update && \
apt-get install -y ca-certificates curl jq libssl-dev pkg-config strace && \
apt-get install -y ca-certificates curl jq libssl-dev pkg-config strace tini && \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It's great that you're adding tini as an init process. However, there are a couple of improvements we can make here:

  1. libssl-dev and pkg-config are build-time dependencies and shouldn't be included in the final runtime image. They increase the image size and potential attack surface. The binary is already built and should link against libssl, not the development headers. The runtime dependency package is libssl3, which is likely pulled in by other packages or is part of the base image.
  2. It's a good practice to use --no-install-recommends with apt-get install to avoid installing unnecessary packages and keep the image size minimal, as you've done in Dockerfile.cross.

I'd suggest removing the development packages and adding this flag.

    apt-get install -y --no-install-recommends ca-certificates curl jq strace tini && \

rm -rf /var/lib/apt/lists/*

WORKDIR /app
Expand All @@ -69,4 +69,4 @@ EXPOSE 30303 30303/udp 9001 8545 8546 7545 8551
HEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \
CMD /usr/local/bin/ev-reth --version || exit 1

ENTRYPOINT ["/usr/local/bin/ev-reth"]
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/ev-reth"]
4 changes: 2 additions & 2 deletions Dockerfile.cross
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ ARG BUILDPLATFORM
# Copy the pre-built binary based on the target platform
COPY dist/bin/${TARGETPLATFORM}/ev-reth /usr/local/bin/ev-reth

RUN apt-get update && apt-get install -y --no-install-recommends curl jq && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y --no-install-recommends curl jq tini && rm -rf /var/lib/apt/lists/*

# Expose default ports
EXPOSE 8545 8546 30303 6060 9001

# Set the entrypoint
ENTRYPOINT ["/usr/local/bin/ev-reth"]
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/ev-reth"]