Skip to content

Request: More practical defaults for .dockerignore #2756

@mcandre

Description

@mcandre

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions