浏览代码

Update ADD documentation to specify new behavior.

Caleb Spare 12 年之前
父节点
当前提交
c383d59880
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      docs/sources/use/builder.rst

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

@@ -152,6 +152,14 @@ destination container.
 
 
 The copy obeys the following rules:
 The copy obeys the following rules:
 
 
+* 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>``.
+* If ``<src>`` is a URL and ``<dest>`` does end with a trailing slash,
+  then the filename is inferred from the URL and the file is downloaded to
+  ``<dest>/<filename>``. For instance, ``ADD http://example.com/foobar /``
+  would create the file ``/foobar``. The URL must have a nontrivial path
+  so that an appropriate filename can be discovered in this case
+  (``http://example.com`` will not work).
 * If ``<src>`` is a directory, the entire directory is copied,
 * If ``<src>`` is a directory, the entire directory is copied,
   including filesystem metadata.
   including filesystem metadata.
 * If ``<src>``` is a tar archive in a recognized compression format
 * If ``<src>``` is a tar archive in a recognized compression format