Skip to content

Conversation

@robnester-rh
Copy link
Contributor

@robnester-rh robnester-rh commented Dec 12, 2025

User description

This commit adds a .dockerignore which ignores the dist/ directory when executing the COPY . . command in the Dockerfile and Dockerfile.dist file when building images. The expectation is that this will resolve the disk usage issues we're seeing.

Ref: EC-1585


PR Type

Enhancement


Description

  • Add .dockerignore file to exclude unnecessary build artifacts

  • Prevents dist/ directory from being copied into Docker images

  • Excludes coverage, node modules, IDE files, and test artifacts

  • Resolves disk usage issues in multi-arch Docker builds


Diagram Walkthrough

flowchart LR
  A["Docker Build Process"] -- "COPY . ." --> B["Image Layer"]
  C[".dockerignore File"] -- "Excludes dist/, node_modules/, etc." --> B
  B -- "Reduced Image Size" --> D["Optimized Docker Image"]
Loading

File Walkthrough

Relevant files
Configuration changes
.dockerignore
Create .dockerignore with build artifact exclusions           

.dockerignore

  • Created new .dockerignore file with Apache 2.0 license header
  • Excludes dist/ directory to prevent host binaries from being copied
  • Excludes coverage files (*.out), node modules, IDE files, and test
    artifacts
  • Includes explanatory comments for multi-arch build compatibility
+36/-0   

@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Dec 12, 2025

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Dec 12, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Security
Prevent leaking environment secrets

Add patterns for environment files like .env and .env.* to .dockerignore to
prevent leaking secrets into the Docker image, while allowing .env.example.

.dockerignore [34-35]

 # Exclude test artifacts
 acceptance/testenv/
 
+# Exclude environment files
+.env
+.env.*
+!.env.example
+
  • Apply / Chat
Suggestion importance[1-10]: 7

__

Why: This suggestion addresses a potential security vulnerability by preventing environment files containing secrets from being included in the Docker build context. It's a valuable proactive measure that follows security best practices.

Medium
Exclude version control system directory

Add .git/ to the .dockerignore file to explicitly exclude the version control
directory from the Docker build context.

.dockerignore [34-35]

 # Exclude test artifacts
 acceptance/testenv/
 
+# Exclude version control system files
+.git/
+
  • Apply / Chat
Suggestion importance[1-10]: 3

__

Why: The suggestion to explicitly ignore the .git directory is a good practice for clarity, even though Docker's CLI typically excludes it by default. It's a minor improvement that makes the .dockerignore file more robust and self-documenting.

Low
  • Update

@codecov
Copy link

codecov bot commented Dec 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
acceptance 54.75% <ø> (-0.01%) ⬇️
generative 18.99% <ø> (ø)
integration 27.92% <ø> (ø)
unit 67.60% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@simonbaird simonbaird left a comment

Choose a reason for hiding this comment

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

Lgtm. I'll fix the task violation if no one else is doing it..

Update: I think #3065 is what we need.

@simonbaird
Copy link
Member

FYI there's a typo in commit message:

-This commit adds a `.dockerfile` 
+This commit adds a `.dockerignore` 

This commit adds a `.dockerignore` which ignores the `dist/` directory
when executing the `COPY . .` command in the `Dockerfile` and
`Dockerfile.dist` file when building images. The expectation is that
this will resolve the disk usage issues we're seeing.

Ref: EC-1585
Signed-off-by: Rob Nester <rnester@redhat.com>
@robnester-rh
Copy link
Contributor Author

FYI there's a typo in commit message:

-This commit adds a `.dockerfile` 
+This commit adds a `.dockerignore` 

Fixed.

@robnester-rh robnester-rh merged commit eaef38d into conforma:main Dec 15, 2025
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants