Skip to content

Commit

Permalink
Clarify the behavior of wildcards in .dockerignore file
Browse files Browse the repository at this point in the history
Unlike .gitignore, `*.md` in .dockerignore doesn't match
`subdir/foo.md`. While the logic is in github.com/moby/patternmatcher,
it is worth to note the difference in the reference document.

Signed-off-by: Kazuyoshi Kato <[email protected]>
  • Loading branch information
kzys committed Jul 12, 2023
1 parent 31a9120 commit 487ef03
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/dockerfile/docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,9 @@ uses this mechanism:
!README.md
```

All markdown files *except* `README.md` are excluded from the context.
All markdown files right under the context directory *except* `README.md`
are excluded from the context. Note that markdown files under subdirectories
are still included.

The placement of `!` exception rules influences the behavior: the last
line of the `.dockerignore` that matches a particular file determines
Expand Down

0 comments on commit 487ef03

Please sign in to comment.