Dockerignore Generator
Toggle the stack presets your image uses, add any custom patterns, and copy or download a clean .dockerignore. The tool ships curated blocks for General, Node, Python, Go and Java, and removes any pattern that two stacks share so each line appears only once. The file it builds shrinks your build context and keeps secrets, caches and VCS data out of the image.
How to generate a .dockerignore
- Click the stack pills your project uses to turn them on (General and Node are selected by default).
- Type any extra rules into Custom patterns, one per line, such as tmp/ or *.local.
- Watch the .dockerignore preview update live as you toggle stacks and edit patterns.
- Click Copy, or Download to save the file straight to disk.
- Place the .dockerignore in the same folder as your Dockerfile, at the build context root.
Examples
Go stack only
stacks: go
# Go bin vendor *.test *.out *.exe dist
Node and Python, shared patterns deduplicated
stacks: node, python
# Node node_modules npm-debug.log ... dist build .next .nuxt # Python __pycache__ *.pyc ... (dist and build are dropped here, already listed under Node)
General preset plus a custom rule
stacks: general; custom: tmp/
# General .git .gitignore .env .env.* *.log Dockerfile .dockerignore README.md LICENSE .DS_Store # Custom tmp/
Frequently asked questions
Why use a .dockerignore?
It tells the Docker daemon which files to leave out of the build context that gets sent before a build. A smaller context means faster builds, and it stops secrets, logs and local caches from being copied into your image by a broad COPY . instruction.
Which stacks does the tool cover?
Five presets: General (git metadata, .env files, logs, README and license), Node (node_modules, debug logs, build output like dist, .next and .nuxt), Python (pycache, virtual envs, test caches), Go (bin, vendor, test and executable output) and Java (target, build, gradle and compiled artifacts).
How does deduplication work?
Patterns are deduplicated globally in selection order, so the first stack to introduce a pattern keeps it. If you pick Node then Python, both list dist and build, but those two lines appear only under Node. A block that is fully absorbed this way is skipped so you never get an empty header.
Do custom patterns get deduplicated too?
Yes. Custom lines are trimmed, blank lines are dropped, and each is checked against everything already emitted by the stacks above. Anything genuinely new is written in a final # Custom block at the bottom of the file.
Should I ignore the Dockerfile itself?
The General preset lists Dockerfile and .dockerignore because they are not needed inside the running image. Delete those two lines if your build deliberately copies the Dockerfile in, for example for a multi-stage step that reads it.
Does .dockerignore use the same syntax as .gitignore?
The glob patterns look similar but the rules are not identical. Docker matches paths from the build context root, treats a leading exclamation mark as a re-include exception, and does not walk parent directories the way git does. Test edge cases before relying on them.
What happens if I select nothing?
The preview shows a short prompt and the output is empty. As soon as you toggle one stack on or add a custom pattern, the file is generated with a trailing newline so it is ready to save.
Is my configuration private?
Yes. The file is assembled entirely in your browser from the built-in presets and your typed patterns. Nothing is uploaded, so project details stay on your device.
Learn more
- How .dockerignore speeds up builds
Why the build context matters, what to exclude for smaller images, and how deduplicated stack presets keep a .dockerignore readable.
Related tools
Dockerfile Generator
Generate a clean, idiomatic Dockerfile for Node, Python, Go, Rust, PHP, Ruby or static sites. Pick your options, then copy or download the file.
Gitignore Generator
Build a .gitignore from Node, Python, Java, Go, Rust, macOS, Windows and more. Pick your stacks, copy or download the file. Runs in your browser.
Docker Compose Generator
Build a valid docker-compose.yml in your browser. Add services, pick Postgres, MySQL, Redis, Mongo or Nginx presets, then copy or download the file.
.env to JSON
Convert a .env file to JSON, or JSON back to .env. Parses KEY=value lines, comments, quotes and export. Runs entirely in your browser.
ASCII Table
Full ASCII table for all 128 codes with decimal, hex, octal and binary values, character names and descriptions. Search by code, hex or character.
Aspect Ratio Box Generator
Generate CSS for a responsive aspect-ratio container. Use the modern aspect-ratio property or the padding-top fallback, then copy the ready code.