You run docker build を実行すると、Docker はビルドディレクトリ内のファイルである ビルドコンテキスト をデーモンに送信します。.dockerignore ファイルは、このコンテキストから不要なファイルを除外し、ビルドを高速化し、イメージサイズを削減し、機密ファイルの漏洩を防ぎます。
ビルドコンテキスト
docker build -t myapp . # the "." is the build context — the directory sent to the daemon
