Skip to content

build: Add .dockerignore to optimize Docker build context #1790

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 3 commits into from
May 6, 2025

Conversation

Prasanjeet-Microsoft
Copy link
Contributor

Purpose

  • This PR adds a ".dockerignore" file to prevent unnecessary files and directories (such as virtual environments, build artifacts, logs, node_modules, and IDE configs) from being sent to the Docker daemon during image builds.
  • Optimizing the build context improves performance and reduces image size and build time.

Does this introduce a breaking change?

  • Yes
  • No

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install
  • Test the code

What to Check

Verify that the following are valid:

  • Confirm .dockerignore is present at root directory.
  • Ensure expected files (e.g. .git, node_modules, __pycache__, etc.) are excluded from build context.
  • Run a Docker build and verify only necessary files are included.
  • Confirm no unintended exclusions (like source code or Dockerfile used for build)

@Roopan-Microsoft Roopan-Microsoft merged commit c7f3e8d into dev May 6, 2025
6 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