fix: improve Dockerfile signal handling and slim runtime#117
fix: improve Dockerfile signal handling and slim runtime#117tac0turtle wants to merge 1 commit intomainfrom
Conversation
- Use SIGINT stop signal for proper graceful shutdown - Remove unnecessary build/debug packages from runtime image (libssl-dev, pkg-config, strace) - Bump healthcheck start-period to 60s Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary of ChangesHello @tac0turtle, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on enhancing the Docker image for the 'ev-reth' application by optimizing its runtime environment and improving container lifecycle management. The changes aim to create a leaner, more robust container that handles shutdowns gracefully and provides a more forgiving startup period for its health checks. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Claude finished @tac0turtle's task —— View job Pull Request ReviewTodo List:
Review FindingsCode Quality and Best Practices ✅The changes follow Docker best practices well:
Potential Issues
|
There was a problem hiding this comment.
Code Review
This pull request improves the Dockerfile by slimming the runtime image and improving signal handling. The changes are good, removing unnecessary build-time packages and setting the stop signal for graceful shutdown. I've added a couple of suggestions to further improve the Dockerfile: one to make the runtime image even smaller by avoiding recommended package installations, and another to make the healthcheck more robust by checking a live service endpoint instead of just the binary's existence. These changes will improve the container's efficiency and reliability.
|
|
||
| RUN apt-get update && \ | ||
| apt-get install -y ca-certificates curl jq libssl-dev pkg-config strace tini && \ | ||
| apt-get install -y ca-certificates curl jq tini && \ |
There was a problem hiding this comment.
To further reduce the image size, it's a good practice to use the --no-install-recommends flag with apt-get install. This prevents the installation of packages that are not strictly required for the main packages to run, contributing to a slimmer runtime image.
apt-get install -y --no-install-recommends ca-certificates curl jq tini && \
| HEALTHCHECK --interval=30s --timeout=3s --start-period=60s --retries=3 \ | ||
| CMD /usr/local/bin/ev-reth --version || exit 1 |
There was a problem hiding this comment.
The current healthcheck command only verifies that the binary is executable, not that the node service is actually running and healthy. This could lead to a situation where the container is considered healthy even if the node has crashed or is unresponsive. A more effective healthcheck would query a live service endpoint, such as the JSON-RPC API, to confirm the service is responsive.
HEALTHCHECK --interval=30s --timeout=3s --start-period=60s --retries=3 \
CMD curl -f -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' -H "Content-Type: application/json" http://localhost:8545 || exit 1
Description
Type of Change
Related Issues
Fixes #(issue)
Checklist
Testing
Additional Notes