Skip to content

Conversation

@jmeridth
Copy link
Contributor

Pull Request

Proposed Changes

  • add .dockerignore to ensure non application files/test files don't get into the container image

Tested locally with the following commands:

➜ docker build . --tag test:1
➜ docker run -it --rm --name debug --entrypoint /bin/bash test:1

## inside container

root@3624b051f2c8:/action/workspace# ls -lah
total 44K
drwxr-xr-x 1 root root 4.0K May 27 13:11 .
drwxr-xr-x 1 root root 4.0K May 27 13:11 ..
-rw-r--r-- 1 root root 1.8K Jan  7 10:26 auth.py
-rw-r--r-- 1 root root 4.4K Mar 30 23:25 env.py
-rw-r--r-- 1 root root   68 Apr  4 04:04 requirements.txt
-rwxr-xr-x 1 root root  14K May 27 12:11 stale_repos.py

Readiness Checklist

Author/Contributor

  • If documentation is needed for this change, has that been included in this pull request
  • run make lint and fix any issues that you have introduced
  • run make test and ensure you have test coverage for the lines you are introducing
  • If publishing new data to the public (scorecards, security scan results, code quality results, live dashboards, etc.), please request review from @jeffrey-luszcz

Reviewer

  • Label as either fix, documentation, enhancement, infrastructure, maintenance or breaking

- [x] add .dockerignore to ensure non application files/test files don't get into the container image

Tested locally with the following commands:

```bash
➜ docker build . --tag test:1
➜ docker run -it --rm --name debug --entrypoint /bin/bash test:1

## inside container

root@3624b051f2c8:/action/workspace# ls -lah
total 44K
drwxr-xr-x 1 root root 4.0K May 27 13:11 .
drwxr-xr-x 1 root root 4.0K May 27 13:11 ..
-rw-r--r-- 1 root root 1.8K Jan  7 10:26 auth.py
-rw-r--r-- 1 root root 4.4K Mar 30 23:25 env.py
-rw-r--r-- 1 root root   68 Apr  4 04:04 requirements.txt
-rwxr-xr-x 1 root root  14K May 27 12:11 stale_repos.py
```

Signed-off-by: jmeridth <[email protected]>
@jmeridth jmeridth self-assigned this May 31, 2025
Copilot AI review requested due to automatic review settings May 31, 2025 21:24
@jmeridth jmeridth requested a review from a team as a code owner May 31, 2025 21:24
@github-actions github-actions bot added the fix label May 31, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a .dockerignore to trim unnecessary files from the Docker build context, reducing image size.

  • Introduce ignore patterns for test scripts, build artifacts, and metadata files
  • Exclude common cache, log, IDE, and dependency directories
  • Skip Git/history and assorted config files from the image

@zkoppert zkoppert merged commit 332fe43 into main Jun 1, 2025
29 checks passed
@zkoppert zkoppert deleted the jm_dockerignore branch June 1, 2025 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants