Skip to content

fix(Dockerfile): move dependencies in base image - #3173

Merged
steebchen merged 5 commits into
mainfrom
fix/df-dep
Apr 17, 2025
Merged

fix(Dockerfile): move dependencies in base image#3173
steebchen merged 5 commits into
mainfrom
fix/df-dep

Conversation

@steebchen

@steebchen steebchen commented Apr 17, 2025

Copy link
Copy Markdown
Contributor

Moved installation of curl, ca-certificates, and tini to the base image stage. Cleaned up apt cache to reduce image size.

Summary by CodeRabbit

  • Chores
    • Updated package installation steps in the Dockerfile for improved clarity and efficiency.
    • Added cleanup steps to reduce image size after package installation.

@coderabbitai

coderabbitai Bot commented Apr 17, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Ohayo sensei! This update modifies the Dockerfile by moving the installation of certain packages (tini, ca-certificates, and curl) from the builder stage to the base stage. The builder stage now only installs development tools needed for building, while the base stage installs runtime dependencies directly using apt-get. The process of copying binaries and certificates from the builder stage to the base stage is removed. Additionally, the base stage now includes cleanup commands to remove package manager caches after installation. The ENTRYPOINT remains set to invoke /tini directly by copying /usr/bin/tini to /tini.

Changes

File(s) Change Summary
Dockerfile Shifted installation of tini, ca-certificates, and curl from builder to base stage; builder stage installs only build tools (git, libtool, automake, autoconf, make); removed copying of binaries and certs from builder to base; added apt cache cleanup in base stage; explicitly copied /usr/bin/tini to /tini in base stage; ENTRYPOINT continues to use /tini.

Possibly related PRs

Suggested reviewers

  • glihm

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between e92c223 and 0a8184e.

📒 Files selected for processing (1)
  • Dockerfile (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • Dockerfile

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
Dockerfile (1)

3-3: ohayo sensei! Standardize installer commands and cleanup in builder stage
The builder stage currently runs apt install -y without cleaning up caches or disabling recommendations. To shrink image layers and avoid extra packages, consider:

- RUN apt-get update && apt install -y git libtool automake autoconf make
+ RUN apt-get update && \
+     DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+       git libtool automake autoconf make && \
+     rm -rf /var/lib/apt/lists/*

This will reduce image size and prevent pulling in unnecessary recommended packages.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a64d6ad and 20258bf.

📒 Files selected for processing (1)
  • Dockerfile (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: x86_64-pc-windows-msvc (windows-latest)
  • GitHub Check: aarch64-apple-darwin (macos-latest)
  • GitHub Check: x86_64-apple-darwin (macos-latest-xlarge)
  • GitHub Check: aarch64-unknown-linux-gnu (ubuntu-latest-8-cores-arm64)
  • GitHub Check: x86_64-unknown-linux-gnu (ubuntu-latest-8-cores)
  • GitHub Check: build

Comment thread Dockerfile Outdated
Moved installation of curl, ca-certificates, and tini to the
base image stage. Cleaned up apt cache to reduce image size.
@codecov

codecov Bot commented Apr 17, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.62%. Comparing base (cf19cf3) to head (0a8184e).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3173      +/-   ##
==========================================
- Coverage   55.62%   55.62%   -0.01%     
==========================================
  Files         443      443              
  Lines       62987    62987              
==========================================
- Hits        35038    35034       -4     
- Misses      27949    27953       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@steebchen
steebchen merged commit 374fd38 into main Apr 17, 2025
@steebchen
steebchen deleted the fix/df-dep branch April 17, 2025 17:39
kariy pushed a commit that referenced this pull request Apr 21, 2025
* fix(Dockerfile): move dependencies in base image

Moved installation of curl, ca-certificates, and tini to the
base image stage. Cleaned up apt cache to reduce image size.

* fix(Dockerfile): adjust tini installation and entrypoint path

Ensure tini is copied to a new path and update the entrypoint
accordingly to prevent runtime issues.
kariy pushed a commit that referenced this pull request Apr 28, 2025
* fix(Dockerfile): move dependencies in base image

Moved installation of curl, ca-certificates, and tini to the
base image stage. Cleaned up apt cache to reduce image size.

* fix(Dockerfile): adjust tini installation and entrypoint path

Ensure tini is copied to a new path and update the entrypoint
accordingly to prevent runtime issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant