Description
When you use theADD or COPY instructions in a Dockerfile, you should
ensure that the files to be copied into the image do not match a pattern present
in .dockerignore. Files which match the patterns in a .dockerignore file are
not present in the context of the image when it is built. Trying to copy or add
a file which is missing from the context will result in a build error.
Build context requirement
This rule needs build context information. In direct Dockerfile mode, pass a local context directory:context declared by the selected target or service:
Examples
Given a.dockerignore containing */tmp/*:
Bad: