Search tools

Find a tool by name or what it does.

.dockerignore Generator

Build a .dockerignore from stack presets for Node, Python, Go, and more. Merge the patterns, drop duplicates, add your own lines, then copy or download the file.

Stack presets

One pattern per line. Start a line with ! to re-include a file, or with # for a comment. Everything runs in your browser. Nothing is uploaded.

Options
.dockerignore
34
Patterns
4
Groups
2
Duplicates removed
Docker patterns are matched against the build context root and differ slightly from a .gitignore. Use **/name to match a folder at any depth.

How to generate a .dockerignore file online

  1. Pick your stacks

    Select the presets that match your project, such as Node, Python, Go, or general build artifacts.

  2. Add custom patterns

    Type any extra patterns or ! negation lines specific to your repository, one per line.

  3. Tune the output

    Turn duplicate removal, sorting, and negation examples on or off to shape the final file.

  4. Copy or download

    Copy the .dockerignore to your clipboard or download it straight into your project root.

Why use this tool

Stack presets that combine

Selecting the Node, Python, Go, build, version control, editor, OS, or secrets presets merges their patterns into one file, so you start from a sensible baseline instead of a blank page.

Cross-preset de-duplication

Overlapping entries like dist and build that appear in several presets collapse to a single line, and a counter shows how many duplicates were removed.

Negation-aware ordering

Sorting keeps ! re-include lines after the rules they override, so alphabetizing the file never quietly breaks a keep pattern.

Copy or download instantly

Copy the result to your clipboard or download a ready-to-commit .dockerignore file for your project root.

Runs entirely in your browser

Everything happens on your device; nothing is uploaded.

About this tool

A .dockerignore file tells a container build which files to leave out of the build context, keeping images smaller and builds faster by skipping things like node_modules, virtual environments, .git, and local editor junk. This generator lets you tick the stacks in your project (Node, Python, Go, general build artifacts, version control, editor and IDE files, OS cruft, and secrets) and merges the matching patterns into one clean file. Anything the presets miss you can add as custom lines, one pattern per line, including ! negations to re-include a specific file.

Because several presets share entries such as dist and build, the tool removes duplicates across the whole file and tells you how many lines it collapsed. Sorting is negation-aware: it keeps ! re-include lines after the exclude rules they depend on, so alphabetizing never silently breaks a keep. If you only need to tidy an existing list, the line sorter and remove duplicate lines tools do those single jobs on any text.

Keep in mind that .dockerignore uses the Docker pattern syntax, which is close to but not identical to a .gitignore file. Patterns are matched against the build context root, ** spans any number of directories, and a leading slash is ignored, so use **/node_modules when you need to match nested folders. The file is generated on your device and never leaves the browser.

Frequently asked questions

How is a .dockerignore different from a .gitignore?
They look similar but use different matching rules. A .dockerignore is evaluated against the build context root using Docker patterns, where ** matches any number of directories and a leading slash is ignored. A plain name like node_modules matches only at the root, so use **/node_modules to also catch nested folders. Because of this, copying a .gitignore verbatim does not always behave the same way.
What do the presets include?
Node covers node_modules, logs, and framework build output. Python covers __pycache__, virtual environments, and test caches. Go covers compiled binaries, test output, and vendor. There are also presets for general build artifacts, version control metadata, editor and IDE files, OS files like .DS_Store and Thumbs.db, and secrets such as .env files and keys.
How do duplicate removal and sorting work?
De-duplication keeps the first occurrence of each pattern and drops later repeats across every preset, then reports the count it removed. Sorting alphabetizes each group, but it is negation-aware: any line starting with ! is kept after the normal patterns so a re-include still overrides the rule it depends on.
Can I add my own patterns and negations?
Yes. Use the custom box to add any patterns your project needs, one per line. Lines starting with ! re-include a path an earlier rule excluded, and lines starting with # are treated as comments and kept as-is. Custom patterns are merged and de-duplicated alongside the presets.
Where do I put the generated file?
Save it as a file named .dockerignore in the root of your build context, usually next to your Dockerfile. The build reads it automatically and skips every matching file before sending the context, which can noticeably speed up builds in large repositories.
Is my data uploaded anywhere?
No. Everything runs in your browser; nothing is sent to a server.

Related tools