From 4978171903b6b41016d4e0d743d13206b9317cda Mon Sep 17 00:00:00 2001 From: Doug Davis Date: Wed, 14 Oct 2015 14:42:21 -0700 Subject: [PATCH] Support multi-dir wildcards in .dockerignore Closes #13113 Signed-off-by: Doug Davis --- docs/reference/builder.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/reference/builder.md b/docs/reference/builder.md index 5479bb001e..7c0e54d249 100644 --- a/docs/reference/builder.md +++ b/docs/reference/builder.md @@ -232,6 +232,11 @@ eliminates `.` and `..` elements using Go's [filepath.Clean](http://golang.org/pkg/path/filepath/#Clean). Lines that are blank after preprocessing are ignored. +Beyond Go's filepath.Match rules, Docker also supports a special +wildcard string `**` that matches any number of directories (including +zero). For example, `**/*.go` will exclude all files that end with `.go` +that are found in all directories, including the root of the build context. + Lines starting with `!` (exclamation mark) can be used to make exceptions to exclusions. The following is an example `.dockerignore` file that uses this mechanism: