Adding details on how to use .dockerignore file

Addresses #7724

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
master
Srini Brahmaroutu 2014-09-23 18:23:15 +00:00 committed by Tibor Vass
parent 3e3d368b74
commit 62cc00b765
1 changed files with 20 additions and 0 deletions

View File

@ -231,6 +231,26 @@ Exclusion patterns match files or directories relative to `PATH` that
will be excluded from the context. Globbing is done using Go's
[filepath.Match](http://golang.org/pkg/path/filepath#Match) rules.
Please note that `.dockerignore` files in other subdirectories are considered as
normal files. Filepaths in .dockerignore are absolute with the current directory
as the root. Wildcards are allowed but the search is not recursive.
### Example .dockerignore file
*/temp*
*/*/temp*
temp?
The first line above `*/temp*`, would ignore all files with names starting with
`temp` from any subdirectory below the root directory, for example file named
`/somedir/temporary.txt` will be ignored. The second line `*/*/temp*`, will
ignore files starting with name `temp` from any subdirectory that is two levels
below the root directory, for example a file `/somedir/subdir/temporary.txt` is
ignored in this case. The last line in the above example `temp?`, will ignore
the files that match the pattern from the root directory, for example files
`tempa`, `tempb` are ignored from the root directory. Currently there is no
support for regular expressions, formats like `[^temp*]` are ignored.
See also:
[*Dockerfile Reference*](/reference/builder).