When you run docker build, Docker sends the build context (the files in the build directory) to the daemon. A .dockerignore file excludes unneeded files from this context — speeding builds, reducing image size, and avoiding leaking sensitive files.
The build context
docker build -t myapp .
