What is the purpose of the Docker build context? I understand, from the documentation, that it's the "entry" point from which the entire contents will be sent to the docker daemon. But what's the point of sending the entire contents of the current directory, assuming the default use case provided in examples, when we must also explicitly include a COPY or ADD directive in the Dockerfile to ACTUALLY include the contents of the current directory in the generated image? If the context is sent to the daemon to be included in the image, then why are we required to make this extra step. Why doesn't the compressed upload/send/copy task include the contents of the specified directory by default?
e.g. Given this directory structure
-rw-r--r-- 1 me me 7 Jun 8 18:52 .dockerignore
-rw-r--r-- 1 me me 1.1K Jun 9 12:42 Dockerfile
drwxr-xr-x 13 me me 4.0K Jun 8 19:43 myproject
When I run this command docker build -t user/myproject:2.3 .
Then I would expect to see an myproject directory somewhere in the generated image. But, I MUST include
ADD myproject /
for that to be the case.
If the build process compresses the current directory contents and sends it to the daemon, where does it go? Why doesn't it make that content available for use in the image?