.dockerignore Generator
Generate a .dockerignore that keeps .git, .env files, keys, node_modules, vendor and build output out of the Docker build context.
Free · No sign-up · Your inputs stay in your browser
Input
Generate a .dockerignore
Output
.dockerignore
318 characters
Everything not ignored is sent to the builder as the build context, so a missing node_modules line can upload hundreds of megabytes before the first step runs, and a missing .env line bakes secrets into an image layer anyone who pulls it can read. Patterns follow Go's filepath.Match, plus ** and ! exceptions.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
Why it matters
Everything not ignored is sent to the builder as the build context before the first instruction runs, so a forgotten node_modules can add hundreds of megabytes and minutes to every build. Worse, COPY . . copies whatever was sent: a .env file in the context ends up in an image layer that anyone who can pull the image can read, even if a later step deletes it.
Pattern syntax
Patterns follow Go's filepath.Match with ** for any number of directories and ! for exceptions, applied in order, as described in the .dockerignore documentation. It is not the same as .gitignore: a bare name matches only at the root unless prefixed with **/.