Skip to content

fix: docker image content #355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 1, 2025
Merged

fix: docker image content #355

merged 1 commit into from
Jun 1, 2025

Conversation

jmeridth
Copy link
Member

  • 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

Pull Request

Proposed Changes

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 <jmeridth@gmail.com>
@jmeridth jmeridth self-assigned this May 31, 2025
@Copilot Copilot AI review requested due to automatic review settings May 31, 2025 21:22
@jmeridth jmeridth requested a review from a team as a code owner May 31, 2025 21:22
@github-actions github-actions bot added the fix label May 31, 2025
Copy link

@Copilot 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 file to prevent non-essential files (tests, caches, docs, IDE settings, etc.) from being included in the Docker image, slimming down the final build.

  • Introduces a comprehensive set of ignore patterns for Python artifacts, logs, docs, IDE directories, dependency caches, Git files, and more.

@zkoppert zkoppert merged commit 514ed58 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.

2 participants