Merge pull request #9635 from duglin/Issue3936

Allow for relative paths on ADD/COPY
This commit is contained in:
Alexander Morozov
2014-12-18 06:58:50 -08:00
6 changed files with 85 additions and 20 deletions
+15 -5
View File
@@ -132,12 +132,22 @@ or
**ADD**
--**ADD <src>... <dest>** The ADD instruction copies new files, directories
or remote file URLs to the filesystem of the container at path <dest>.
or remote file URLs to the filesystem of the container at path <dest>.
Mutliple <src> resources may be specified but if they are files or directories
then they must be relative to the source directory that is being built
(the context of the build). <dest> is the absolute path to
which the source is copied inside the target container. All new files and
directories are created with mode 0755, with uid and gid 0.
then they must be relative to the source directory that is being built
(the context of the build). The <dest> is the absolute path, or path relative
to `WORKDIR`, into which the source is copied inside the target container.
All new files and directories are created with mode 0755 and with the uid
and gid of 0.
**COPY**
--**COPY <src> <dest>** The COPY instruction copies new files from <src> and
adds them to the filesystem of the container at path <dest>. The <src> must be
the path to a file or directory relative to the source directory that is
being built (the context of the build) or a remote file URL. The `<dest>` is an
absolute path, or a path relative to `WORKDIR`, into which the source will
be copied inside the target container. All new files and directories are
created with mode 0755 and with the uid and gid of 0.
**ENTRYPOINT**
--**ENTRYPOINT** has two forms: ENTRYPOINT ["executable", "param1", "param2"]
+6 -4
View File
@@ -65,10 +65,12 @@ directory called httpd may be used to store Dockerfiles for Apache web
server images.
It is also a good practice to add the files required for the image to the
sub-directory. These files will then be specified with the `ADD` instruction
in the Dockerfile. Note: If you include a tar file (a good practice!), then
Docker will automatically extract the contents of the tar file
specified within the `ADD` instruction into the specified target.
sub-directory. These files will then be specified with the `COPY` or `ADD`
instructions in the `Dockerfile`.
Note: If you include a tar file (a good practice), then Docker will
automatically extract the contents of the tar file specified within the `ADD`
instruction into the specified target.
## Building an image and naming that image