Skip to content

ronald2wing/.dockerignore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

.dockerignore Templates

Production-ready .dockerignore files for 87+ languages, frameworks, and tools.

Website License Templates

Docker sends the entire build context to the daemon. A proper .dockerignore strips secrets, artifacts, caches, and editor files — making builds faster, leaner, and secure.

Quick Start

# Framework template (self-contained, includes security)
curl -o .dockerignore https://raw.githubusercontent.com/ronald2wing/.dockerignore/master/frameworks/react.dockerignore

# Language template + security (language templates omit security patterns)
curl -o .dockerignore https://raw.githubusercontent.com/ronald2wing/.dockerignore/master/languages/python.dockerignore
curl -s https://raw.githubusercontent.com/ronald2wing/.dockerignore/master/common/security.dockerignore >> .dockerignore

# Interactive builder: https://dockerignore.com

Categories

Category Directory Description
Framework frameworks/ Self-contained. Security first. Use standalone.
Language languages/ Language patterns only. Combine with common/.
Common common/ Cross-cutting: security, cache, logs, git, Docker.
Tool tools/ Build tools: webpack, vite, esbuild, etc.
IDE ides/ Editor configs: VS Code, IntelliJ, vim, etc.
OS os/ OS temp/system files: Linux, macOS, Windows.

Combining Templates

# Language + common modules
cat languages/python.dockerignore common/security.dockerignore common/cache.dockerignore > .dockerignore

# Deduplicate when combining
cat languages/node.dockerignore common/security.dockerignore common/git.dockerignore | sort -u > .dockerignore

# Full stack: framework + OS + IDE (deduplicate with sort -u)
cat frameworks/nextjs.dockerignore os/linux.dockerignore ides/visual-studio-code.dockerignore | sort -u > .dockerignore

Why This Matters

  • Security — Including .env files in an image leaks credentials. Every framework template puts security first.
  • Build speed — Excluding node_modules/, target/, and .git/ shrinks the build context from hundreds of MB to kilobytes.
  • Cache efficiency — Fewer files means fewer cache invalidations and faster rebuilds.

Contributing

See CONTRIBUTING.md for the PR process and TEMPLATE_STANDARDS.md for the specification every template must follow.

Links

About

A collection of useful .dockerignore templates

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors