docker build . in a directory?The build context is the set of files located in the specified directory (and its subdirectories) that are sent to the Docker daemon. This allows the Dockerfile to reference these files during the build.
docker build . in a directory containing a 1GB video file not referenced in the Dockerfile. What is the most likely effect on the build process?Docker sends the entire directory content as the build context, even if some files are not used in the Dockerfile. Large files increase build time due to transfer overhead.
.dockerignore file content will exclude all .log files and the temp directory from the build context?The .dockerignore file uses patterns similar to .gitignore. To exclude a directory, end its name with a slash. To exclude files by extension, use *.log.
If you don't exclude files with .dockerignore, all files in the directory are sent as build context, which can be very large and slow.
First, review the Dockerfile to reduce unnecessary file copies. Then create a .dockerignore to exclude files. Next, run the build. Finally, test and measure improvements.