cli icon indicating copy to clipboard operation
cli copied to clipboard

Request: More practical defaults for .dockerignore

Open mcandre opened this issue 1 year ago • 0 comments

Description

By default, docker builds should exclude common patterns from ADD / COPY directives:

  • *Dockerfile*, including the standard Dockerfile path, as well as any user custom Dockerfile.<extension>, Dockerfile-<extension>, <environment>.Dockerfile, <environment>-Dockerfile, etc. auxiliary configurations
  • Positive matches from git ls-files, including the per-directory .gitignore system and gitignore --global per-user system. The latter is a scalable way to maintain OS and editor specific exclusion patterns, without having to track thousands of these depending on random contributor machine setups. The Go library https://github.com/go-git/go-git can help manage that.
  • Positive matches from ignore configurations in Subversion, Mercurial, Perforce, and other alternative version control systems.

mcandre avatar Oct 21 '24 02:10 mcandre