Docker-DCO-1.1-Signed-off-by: Fred Lifton <fred.lifton@docker.com> (github: fredlf)
| ... | ... |
@@ -27,6 +27,19 @@ the build. The build is run by the Docker daemon, not by the CLI, so the |
| 27 | 27 |
whole context must be transferred to the daemon. The Docker CLI reports |
| 28 | 28 |
"Sending build context to Docker daemon" when the context is sent to the daemon. |
| 29 | 29 |
|
| 30 |
+> **Warning** |
|
| 31 |
+> Avoid using your root directory, `/`, as the root of the source repository. The |
|
| 32 |
+> `docker build` command will use whatever directory contains the Dockerfile as the build |
|
| 33 |
+> context(including all of its subdirectories). The build context will be sent to the |
|
| 34 |
+> Docker daemon before building the image, which means if you use `/` as the source |
|
| 35 |
+> repository, the entire contents of your hard drive will get sent to the daemon. You |
|
| 36 |
+> probably don't want that. |
|
| 37 |
+ |
|
| 38 |
+In most cases, it's best to put each Dockerfile in an empty directory, and then add only |
|
| 39 |
+the files needed for building that Dockerfile to that directory. To further speed up the |
|
| 40 |
+build, you can exclude files and directories by adding a `.dockerignore` file to the same |
|
| 41 |
+directory. |
|
| 42 |
+ |
|
| 30 | 43 |
You can specify a repository and tag at which to save the new image if |
| 31 | 44 |
the build succeeds: |
| 32 | 45 |
|