The build context
The build context is everything that gets sent to the Docker daemon when using the build image command. This includes the Dockerfile and the contents of the current working directory when the build command is issued, including all subdirectories that the current working directory may contain. It is possible to have the Dockerfile in a directory other than the current working directory by using a -f or --file option, but the Dockerfile still gets sent with the build context. Using the .dockerignore file, you can exclude files and folders from the build context when it gets sent to the Docker daemon.
When building Docker images, it is very important to keep the build context as small as possible. This is because the entire ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access