Skip to content

chore: add .git to .dockerignore#150

Merged
rollandf merged 2 commits intoMellanox:masterfrom
maze88:master
Feb 4, 2026
Merged

chore: add .git to .dockerignore#150
rollandf merged 2 commits intoMellanox:masterfrom
maze88:master

Conversation

@maze88
Copy link
Collaborator

@maze88 maze88 commented Feb 4, 2026

No description provided.

@github-actions
Copy link

github-actions bot commented Feb 4, 2026

Thanks for your PR,
To run vendors CIs, Maintainers can use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs, Maintainers can use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@greptile-apps
Copy link

greptile-apps bot commented Feb 4, 2026

Greptile Overview

Greptile Summary

This PR updates the .dockerignore pattern from .git/ to **/.git, which changes the scope from excluding only the root-level .git directory to excluding .git directories at any nesting level in the build context.

Key changes:

  • Pattern changed from .git/ to **/.git
  • The ** glob pattern matches .git directories at any depth
  • Removes the trailing slash, making it match both files and directories named .git
  • Ensures .git directories from submodules or nested structures are also excluded from Docker builds

Impact:

  • Reduces Docker build context size by excluding all .git directories
  • Improves build performance and security by preventing unnecessary version control data from being copied into images
  • More robust pattern that handles edge cases with submodules or vendored dependencies

Confidence Score: 4/5

  • This PR is safe to merge with minimal risk
  • The change is a simple improvement to the .dockerignore pattern that makes it more robust. It follows Docker best practices and has no functional impact on the application code. The only minor consideration is the removal of the trailing slash, which changes the pattern from directory-only to matching both files and directories, though in practice .git is always a directory.
  • No files require special attention

Important Files Changed

Filename Overview
.dockerignore Changed pattern from .git/ to **/.git to exclude .git directories at any nesting level

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Docker as Docker Build
    participant Context as Build Context
    participant Image as Docker Image
    
    Dev->>Docker: docker build .
    Docker->>Context: Read .dockerignore
    Context->>Context: Apply pattern **/.git
    Note over Context: Excludes .git directories<br/>at any nesting level
    Context->>Docker: Send filtered context
    Note over Docker: .git directories excluded<br/>from build context
    Docker->>Image: Build image without .git
    Image-->>Dev: Smaller, cleaner image
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Signed-off-by: Michael Zeevi <mzeevi@nvidia.com>
Signed-off-by: Michael Zeevi <mzeevi@nvidia.com>
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@rollandf rollandf merged commit 8653cc5 into Mellanox:master Feb 4, 2026
11 of 13 checks passed
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.

2 participants