The result of this dockerfile is that second and third lines are considered a single instruction: in the root directory of the context.
If this file exists, the CLI modifies the context to exclude files and directories that match patterns in it.
In most cases, it’s best to start with an empty directory as context and keep your Dockerfile in that directory.
Add only the files needed for building the Dockerfile.
Therefore, all parser directives must be at the very top of a . Line continuation characters are not supported in parser directives.
Due to these rules, the following examples are all invalid: Invalid due to line continuation: at the end of the third line would, assuming it was actually handled as an instruction, cause it be treated as a line continuation.
This helps to avoid unnecessarily sending large or sensitive files and directories to the daemon and potentially adding them to images using file as a newline-separated list of patterns similar to the file globs of Unix shells.