Skip to content

fix: docker image content #529

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 #529

merged 1 commit into from
Jun 1, 2025

Conversation

jmeridth
Copy link
Member

@jmeridth jmeridth commented May 31, 2025

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

@jmeridth jmeridth self-assigned this May 31, 2025
@Copilot Copilot AI review requested due to automatic review settings May 31, 2025 21:14
@jmeridth jmeridth requested a review from a team as a code owner May 31, 2025 21:14
@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 introduces a .dockerignore file to prevent non-essential files (tests, caches, VCS artifacts, etc.) from being included in the Docker build context, resulting in a smaller and cleaner image.

  • Adds .dockerignore with patterns excluding test files, Python artifacts, docs, logs, IDE configs, dependency and cache directories, and Git metadata.

- [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>
@zkoppert zkoppert merged commit f5fd0f8 into main Jun 1, 2025
36 checks passed
@zkoppert zkoppert deleted the jm_dockerignore branch June 1, 2025 06:15
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