Skip to main content
DevOps Tools

.dockerignore Generator

Generate a .dockerignore file for your stack to keep unnecessary files out of your Docker build context.

Select the technologies your project uses and this tool combines the right ignore patterns into one .dockerignore file.

A smaller build context means faster `docker build` runs - keeping node_modules, .git, and similar folders out matters more than it might seem.

What Is a .dockerignore File?

A .dockerignore file tells Docker which files and folders to exclude from the build context sent to the Docker daemon - similar in spirit to .gitignore, but specifically for what gets sent during docker build.

Why Use This Tool?

Without a .dockerignore, folders like node_modules, .git, and local environment files get needlessly copied into the build context, slowing builds and sometimes leaking secrets into image layers. This tool combines the right patterns for your stack.

How to Use It

  1. Select the technologies your project uses.
  2. Click Generate.
  3. Copy the combined .dockerignore content into your project root.

Limitations

This covers common, well-known patterns - always review the result and add any project-specific paths it doesn't already cover.

Frequently Asked Questions

It excludes files from the build context sent to Docker. This speeds up builds and keeps things like node_modules, .git and .env files out of your image.

In the root of the build context - usually the same folder as your Dockerfile and the "." in docker build.

Otherwise a COPY . . instruction can bake secrets into the image, where anyone who can pull the image can read them. Pass configuration at runtime instead.
Share this tool: