Skip to content

Commit 0704c2b

Browse files
committed
[ADD] Add copy for docker.
1 parent 52f775b commit 0704c2b

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

docker/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,32 @@ There can only be one CMD instruction in a Dockerfile. If you list more than one
105105
#### ENV
106106
#### ADD
107107
#### COPY
108+
The ```COPY``` instruction copies new files or directories from ```<src>``` and adds them to the filesystem of the container at the path ```<dest>```.
109+
110+
Multiple ```<src>``` resources may be specified but the paths of files and directories will be interpreted as relative to the source of the context of the build.
111+
112+
**COPY has two forms:**
113+
114+
```shell
115+
COPY [--chown=<user>:<group>] <src>... <dest>
116+
COPY [--chown=<user>:<group>] ["<src>",... "<dest>"]
117+
```
118+
119+
**Example**
120+
```shell
121+
COPY --chown=55:mygroup files* /somedir/
122+
COPY --chown=bin files* /somedir/
123+
COPY --chown=1 files* /somedir/
124+
COPY --chown=10:11 files* /somedir/
125+
```
126+
127+
COPY obeys the following rules:
128+
- The <src> path must be inside the context of the build; you cannot COPY ../something /something, because the first step of a docker build is to send the context directory (and subdirectories) to the docker daemon.
129+
- If <src> is a directory, the entire contents of the directory are copied, including filesystem metadata.
130+
131+
132+
133+
108134
#### ENTRYPOINT
109135
#### VOLUME
110136
#### USER

0 commit comments

Comments
 (0)