Skip to content

Commit

Permalink
docs: reference: builder: update documentation about COPY and ADD
Browse files Browse the repository at this point in the history
Add some documentation for the new semantics of COPY, ADD and USER.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
  • Loading branch information
cyphar committed Mar 12, 2016
1 parent 7e69406 commit ef17285
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions docs/reference/builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,11 @@ the source will be copied inside the destination container.
ADD test relativeDir/ # adds "test" to `WORKDIR`/relativeDir/
ADD test /absoluteDir/ # adds "test" to /absoluteDir/

All new files and directories are created with a UID and GID of 0.
All new files and directories are created with the owner being the same user as
specified by the `USER` directive. If the user has not been set the default is
the same as `RUN`, the user with a UID and GID of 0. The only exception to this
being the unpacking of archives, which retains the owners of the files in the
archive.

In the case where `<src>` is a remote file URL, the destination will
have permissions of 600. If the remote file being retrieved has an HTTP
Expand Down Expand Up @@ -693,7 +697,9 @@ the source will be copied inside the destination container.
COPY test relativeDir/ # adds "test" to `WORKDIR`/relativeDir/
COPY test /absoluteDir/ # adds "test" to /absoluteDir/

All new files and directories are created with a UID and GID of 0.
All new files and directories are created with the owner being the same user as
specified by the `USER` directive. If the user has not been set the default is
the same as `RUN`, the user with a UID and GID of 0.

> **Note**:
> If you build using STDIN (`docker build - < somefile`), there is no
Expand Down

0 comments on commit ef17285

Please sign in to comment.