How it works...
When we build a Docker image using the docker image build command, we specify a directory. This command bundles the entire directory tree as the build context and transfers it to the Docker engine to create the Docker image. This is evident from the build output Sending build context to Docker daemon 2.048 kB message. If there is a file named .dockerignore in the current working directory with the list of files and directories (new-line separated), then those files and directories will be ignored in the build context. More details about .dockerignore can be found at https://docs.docker.com/reference/builder/#the-dockerignore-file.
Now, the Docker build system will read each instruction in the Dockerfile, launch an intermediate ...
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