Skip to main content

Dockerignore Generator

Generate a .dockerignore file by selecting the language/framework stacks your project uses — Node.js, Python, Go, Rust, Java/Maven/Gradle, Ruby, PHP, .NET, Elixir, Flutter — plus common VCS, IDE, OS and CI patterns. Merges the chosen templates, de-duplicates repeated patterns, and lets you append custom rules.

Input

Select every stack and pattern group your project uses from the lists below. Their .dockerignore rules are merged (duplicates removed) into a single file below.

Custom Patterns

Appended under a “Custom Patterns” header. Lines starting with # are kept as comments.

Output

Generated .dockerignore
 
Was this helpful?

Guides

Create a ready-to-use .dockerignore file in seconds by selecting the language and framework stacks your project actually uses from a searchable list. The generator merges the matching ignore rules into one clean file, removes duplicate patterns, and lets you append your own custom lines.

What is a .dockerignore file?

A .dockerignore file tells docker build which files and folders to exclude from the build context — the set of files sent to the Docker daemon before the image is built. Excluding dependency folders (node_modules/, vendor/), version-control metadata (.git/), local secrets (.env), IDE clutter (.idea/, .vscode/) and language build artifacts keeps the context small, speeds up every build, and stops layer-cache invalidation from files that never belong in the image.

How to use this generator

  1. Select every stack in your project — for example Node.js and Version Control for a typical Node service, or Python and CI / Docs / Logs for a Python app. Each category is its own searchable list, so you can type to filter instead of scrolling.
  2. The output updates instantly as you add or remove a selection.
  3. Add any project-specific rules in the Custom Patterns box, one per line. Lines beginning with # are preserved as comments.
  4. Copy the result or download it directly as .dockerignore into the same directory as your Dockerfile.

How the merge works

Each selected template is written under its own # Name header so the file stays readable and easy to audit. Patterns are de-duplicated globally: if two stacks both exclude dist/ or build/, the pattern appears only once, under the first template that declares it. That means you can safely combine several languages, plus the common VCS/IDE/OS/CI groups, without ending up with a file full of repeated lines.

Which templates are included?

  • Common — Version Control (.git/), IDEs & Editors, OS Files, CI / Docs / Logs
  • Languages & runtimes — Node.js, Python, Go, Rust, Java/Maven/Gradle, Ruby, PHP, .NET, Elixir, Flutter

Where does the .dockerignore file go?

Place it next to the Dockerfile it applies to — Docker looks for a .dockerignore in the root of the build context by default. For a multi-stage or multi-service setup with several Dockerfiles, each build context can have its own.

Does .dockerignore work like .gitignore?

The pattern syntax is similar, but the intent is different: .gitignore decides what Git tracks, while .dockerignore decides what reaches the build context. A file can legitimately belong in one and not the other — for example you generally want .git/ itself excluded from the build context even though Git obviously tracks your repository.

Is this private?

Yes. Everything runs entirely in your browser — your selections and custom patterns are never uploaded to a server.

Related tools

dockerignoredockergeneratordeveloper toolsbuild contextcontainer

Use it from code

From 3 credits per call

REST API

curl -X POST https://api.iotools.cloud/v1/tool/dockerignore-generator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "groupLanguagesRuntimes": "[\"tplNode\"]"
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `dockerignore-generator` tool (Dockerignore Generator) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.