docs: document dockerignore update

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Tonis Tiigi 2019-05-24 12:07:52 -07:00 committed by Sebastiaan van Stijn
parent f7009ee126
commit 4f3bc15817
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C

View File

@ -324,7 +324,16 @@ Successfully built 99cc1ad10469
This example shows the use of the `.dockerignore` file to exclude the `.git` This example shows the use of the `.dockerignore` file to exclude the `.git`
directory from the context. Its effect can be seen in the changed size of the directory from the context. Its effect can be seen in the changed size of the
uploaded context. The builder reference contains detailed information on uploaded context. The builder reference contains detailed information on
[creating a .dockerignore file](../builder.md#dockerignore-file) [creating a .dockerignore file](../builder.md#dockerignore-file).
When using the [BuildKit backend](../builder.md#buildkit), `docker build` searches
for a `.dockerignore` file relative to the Dockerfile name. For example, running
`docker build -f myapp.Dockerfile .` will first look for an ignore file named
`myapp.Dockerfile.dockerignore`. If such a file is not found, the `.dockerignore`
file is used if present. Using a Dockerfile based `.dockerignore` is useful if a
project contains multiple Dockerfiles that expect to ignore different sets of
files.
### Tag an image (-t) ### Tag an image (-t)