Browse Source

Merge pull request #2681 from SvenDowideit/add-instruction-path-limitations

add a little more info about the limitations of ADD wrt ../ and docker build
Andy Rothfusz 11 years ago
parent
commit
077c2496ed
1 changed files with 8 additions and 0 deletions
  1. 8 0
      docs/sources/use/builder.rst

+ 8 - 0
docs/sources/use/builder.rst

@@ -221,8 +221,16 @@ destination container.
 All new files and directories are created with mode 0755, uid and gid
 All new files and directories are created with mode 0755, uid and gid
 0.
 0.
 
 
+.. note::
+   if you build using STDIN (``docker build - < somefile``), there is no build 
+   context, so the Dockerfile cannot contain an ADD statement.
+
 The copy obeys the following rules:
 The copy obeys the following rules:
 
 
+* The ``<src>`` path must be inside the *context* of the build; you cannot 
+  ``ADD ../something /something``, because the first step of a 
+  ``docker build`` is to send the context directory (and subdirectories) to 
+  the docker daemon.
 * If ``<src>`` is a URL and ``<dest>`` does not end with a trailing slash,
 * If ``<src>`` is a URL and ``<dest>`` does not end with a trailing slash,
   then a file is downloaded from the URL and copied to ``<dest>``.
   then a file is downloaded from the URL and copied to ``<dest>``.
 * If ``<src>`` is a URL and ``<dest>`` does end with a trailing slash,
 * If ``<src>`` is a URL and ``<dest>`` does end with a trailing slash,