Skip to content

Exclude git metadata from deployment images - #3005

Open
sylvesterkaczmarek wants to merge 1 commit into
openai:mainfrom
sylvesterkaczmarek:fix/deployment-dockerignore-git
Open

Exclude git metadata from deployment images#3005
sylvesterkaczmarek wants to merge 1 commit into
openai:mainfrom
sylvesterkaczmarek:fix/deployment-dockerignore-git

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Summary

  • Add .git to the Deployment Manager's generated .dockerignore.
  • Keep all existing generated ignore entries and Dockerfile behavior unchanged.

Motivation

The generated Dockerfile uses COPY . ., while the generated .dockerignore currently excludes virtual environments, .env, data, uploads, and other local state but not the project's .git directory.

For a Git-backed project, that sends repository history and metadata into the Docker build context and can copy it into the image. Besides unnecessary build context and image size, this can expose commit history, branch metadata, and configured repository remotes inside the built container.

The generated ignore file should exclude .git by default. Existing user-supplied .dockerignore files are not overwritten by this helper.

Validation

This is a single added ignore entry:

  • generated .dockerignore now excludes .git
  • application source files remain included
  • existing ignore entries are unchanged
  • existing project .dockerignore files remain untouched

Self-review

  • One-line correctness/hardening change in one file.
  • Dockerfile commands and deployment behavior are otherwise unchanged.
  • No dependencies, notebooks, registry entries, or documentation changed.
  • Searched open PRs for an existing Deployment Manager .git ignore fix and found none.

Maintainers may modify the branch if needed.

@sylvesterkaczmarek
sylvesterkaczmarek requested a review from a team as a code owner August 21, 2026 15:07
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.

1 participant