Boneyard Tools

Dockerignore Generator

Pick the stacks in your image, add any custom patterns, and copy a clean .dockerignore that shrinks your build context and keeps secrets, caches and VCS data out.

How to generate a .dockerignore

  1. Select the stacks your project uses, such as Node or Python.
  2. Add any custom patterns you want excluded from the build context.
  3. Copy the generated .dockerignore into the same folder as your Dockerfile.

Examples

Node and Python combined

stacks: node, python
# Node
node_modules
npm-debug.log
...

# Python
__pycache__
*.pyc
venv
...

Frequently asked questions

Why use a .dockerignore?

It tells Docker which files to leave out of the build context. A smaller context means faster builds and avoids copying secrets, logs and local caches into your image.

How does deduplication work?

Patterns shared by more than one stack are written only once, under the first stack that introduces them, so the file stays clean and easy to read.

Should I ignore the Dockerfile itself?

The General preset excludes the Dockerfile and .dockerignore because they are not needed inside the image. Remove those lines if your build copies them in on purpose.

Does .dockerignore use the same syntax as .gitignore?

The patterns look similar but the rules differ slightly. Docker matches against the build context root and supports a leading exclamation mark to re-include files.

Is my configuration private?

Yes. The file is built entirely in your browser and nothing is uploaded.

Related tools