Dockerignore Generator
Generate a .dockerignore file by selecting common patterns to exclude from the Docker build context for faster, smaller builds.
Last reviewed by the Radiatus Cloud team
Generate a .dockerignore file to speed up Docker builds and keep secrets out.
Want this automated for your stack?
We build CI/CD, Kubernetes & IaC pipelines that scale.
Generate a .dockerignore file
A .dockerignore file tells Docker which files and folders to exclude from the build context, the set of files sent to the Docker daemon when you build an image. This generator produces one from a checklist of the patterns almost every project should ignore, such as node_modules, the .git directory, environment files and secrets, logs, build output, operating-system junk files and IDE configuration. Tick the ones that apply and copy the result into a file named .dockerignore at your build root.
Excluding unnecessary files keeps the build context small and prevents sensitive files from being copied into images.
Faster, safer builds
A bloated build context slows every build because all those files are uploaded to the daemon, even if the Dockerfile never copies them. More importantly, failing to ignore secrets means a careless COPY instruction can bake API keys and private certificates into your image, where they can leak. Ignoring node_modules also avoids shipping a host-built dependency tree that should be installed fresh inside the image.
The patterns here mirror those in a good .gitignore, adapted for Docker. Review the list against your project and add anything specific. All generation happens locally in your browser.
Related tools
- CI/CD Security Gap Analyzer — Checklist based analyzer for CI/CD pipeline security gaps.
- Docker Security Scanner — A new tool extracted from the codebase.
- Terraform Scanner — A new tool extracted from the codebase.
- SQL Formatter — Format and indent SQL queries for readability. Handles joins, subqueries and CTEs, supports common dialects, and runs entirely in your browser.
Frequently Asked Questions
What is a .dockerignore file?
It lists files and folders to exclude from the Docker build context, keeping builds fast and preventing unwanted files from entering images.
Why ignore node_modules?
Shipping host-built dependencies bloats the context and can cause platform mismatches. It is better to install dependencies fresh inside the image.
Does it prevent secrets from leaking?
Ignoring .env, keys and certificates stops a broad COPY instruction from baking secrets into the image, a common and serious mistake.
Where do I put the file?
Name it .dockerignore and place it in the same directory as your Dockerfile, at the root of the build context.
Privacy & Security
Everything runs in your browser; nothing is uploaded.
How to Use
Tick the patterns to exclude, then copy the .dockerignore.
Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.