Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
| ... | ... |
@@ -227,6 +227,26 @@ Exclusion patterns match files or directories relative to `PATH` that |
| 227 | 227 |
will be excluded from the context. Globbing is done using Go's |
| 228 | 228 |
[filepath.Match](http://golang.org/pkg/path/filepath#Match) rules. |
| 229 | 229 |
|
| 230 |
+Please note that `.dockerignore` files in other subdirectories are considered as |
|
| 231 |
+normal files. Filepaths in .dockerignore are absolute with the current directory |
|
| 232 |
+as the root. Wildcards are allowed but the search is not recursive. |
|
| 233 |
+ |
|
| 234 |
+### Example .dockerignore file |
|
| 235 |
+ */temp* |
|
| 236 |
+ */*/temp* |
|
| 237 |
+ temp? |
|
| 238 |
+ |
|
| 239 |
+The first line above `*/temp*`, would ignore all files with names starting with |
|
| 240 |
+`temp` from any subdirectory below the root directory, for example file named |
|
| 241 |
+`/somedir/temporary.txt` will be ignored. The second line `*/*/temp*`, will |
|
| 242 |
+ignore files starting with name `temp` from any subdirectory that is two levels |
|
| 243 |
+below the root directory, for example a file `/somedir/subdir/temporary.txt` is |
|
| 244 |
+ignored in this case. The last line in the above example `temp?`, will ignore |
|
| 245 |
+the files that match the pattern from the root directory, for example files |
|
| 246 |
+`tempa`, `tempb` are ignored from the root directory. Currently there is no |
|
| 247 |
+support for regular expressions, formats like `[^temp*]` are ignored. |
|
| 248 |
+ |
|
| 249 |
+ |
|
| 230 | 250 |
See also: |
| 231 | 251 |
|
| 232 | 252 |
[*Dockerfile Reference*](/reference/builder). |