.dockerignore Pattern Tester: see which rule decides each path

Paste the .dockerignore file Docker will use and a list of context-relative paths. You get an Included or Excluded verdict, the deciding line, and the full rule trace in your browser. These are path probes, not a filesystem scan or Docker build.

Effective file

Tests the root file.

Rules and paths stay in your browser.

Final rules decide Included or Excluded.

Start with the file Docker will actually use

Use the root .dockerignore when Docker builds with the file at the build-context root. If the selected Dockerfile has a sibling such aslint.Dockerfile.dockerignore, that file takes precedence. Test it alone because Docker does not merge it with the root file.

Useful probes sit around the boundary you are debugging: the directory named by a rule, a file below it, every exception, and the source of each COPY or ADDinstruction you care about. Enter them relative to the build-context root.

Docker patterns are ordered, not combined

Docker evaluates active lines from top to bottom. The last matching line decides whether a path is Included or Excluded, and a line beginning with ! creates an exception. Blank lines and the historical . pattern are inactive after preprocessing.

PatternWhat it does
foo/barMatches that context-relative path. Leading and trailing slashes are disregarded.
*/temp*Matches names beginning with temp inside an immediate child directory.
**/*.goMatches files ending in .go at any directory depth, including the context root.
temp?Matches a root name such as tempa, where ? stands for one character.
!README.mdCreates an exception that includes the root README.md if an earlier rule excluded it.
# noteIs a comment only when # is the first character in column 1.

The deciding rule is the answer; the trace explains it

Every path starts Included. A normal matching line makes it Excluded, while a matching exception makes it Included again. The deciding rule is the last line that changed that state. Earlier matches stay in the trace so the result can be audited.

The built-in example uses docs followed by !docs/README.md.Parent means the first rule matched an ancestor while the submitted file was resolved. It is trace evidence, not the final verdict. The later Direct exception makesdocs/README.md Included by line 2.

When a result surprises you, check these four things

  1. Effective source: confirm whether the build uses the root file or a Dockerfile-specific file.
  2. Line order: a later matching rule can reverse every earlier match.
  3. Normalized input: compare the displayed normalized path and pattern diagnostics with what you pasted.
  4. Builder behavior: matcher verdicts for Docker control files do not describe all transfer or copy restrictions.

What this tester proves, and what it cannot

BoundaryWhat it means
Path probesSubmitted paths are probes. They need not exist.
MatchingThis is not a build or filesystem walk. It does not inspect symlinks, permissions, file sizes, or the source paths used by COPY and ADD.
IncludedIncluded is not a safety guarantee.
Builder control filesDockerfile, .dockerignore, and Dockerfile-specific ignore files have separate builder transfer behavior.
Effective sourceA Dockerfile-specific ignore file takes precedence over the root file. The files are not merged.
CompatibilityThis TypeScript compatibility port is pinned to and fixture-tested against Moby patternmatcher v0.6.1, not a claim about every current Docker build.
Local handlingPattern testing uses the rules and paths already in this browser. There is no repository or file upload.

Confirm the final context with Docker

For end-to-end proof, run a real build against the actual context and verify the relevantCOPY or ADD step. The official Docker documentationexplains file placement, pattern syntax, exceptions, and builder control files. If the machine is not ready yet, install Dockerfirst.