diff options
| author | Misty Stanley-Jones <misty@apache.org> | 2017-04-03 16:54:34 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-04-03 16:54:34 -0700 |
| commit | 473c5701cb66403b0535a5c01845cb0f27fbeb47 (patch) | |
| tree | 9a40326ad4b426655abca7377dc30da003847d4d /docs/reference/commandline/cp.md | |
| parent | ce07fb6b0f1b8765b92022e45f96bd4349812e06 (diff) | |
| parent | 71e6babfa2598669218177b5b429e873b7f35e8f (diff) | |
| download | docker-1.13.x.tar.gz | |
Merge pull request #32332 from mstanleyjones/1.13.x1.13.x
Cherry-pick command-line ref improvements
Diffstat (limited to 'docs/reference/commandline/cp.md')
| -rw-r--r-- | docs/reference/commandline/cp.md | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/docs/reference/commandline/cp.md b/docs/reference/commandline/cp.md index fcfd35fce1..abd3a37df2 100644 --- a/docs/reference/commandline/cp.md +++ b/docs/reference/commandline/cp.md @@ -31,6 +31,8 @@ Options: --help Print usage ``` +## Description + The `docker cp` utility copies the contents of `SRC_PATH` to the `DEST_PATH`. You can copy from the container's file system to the local machine or the reverse, from the local filesystem to the container. If `-` is specified for @@ -96,15 +98,16 @@ you must be explicit with a relative or absolute path, for example: It is not possible to copy certain system files such as resources under `/proc`, `/sys`, `/dev`, [tmpfs](run.md#mount-tmpfs-tmpfs), and mounts created by the user in the container. However, you can still copy such files by manually -running `tar` in `docker exec`. For example (consider `SRC_PATH` and `DEST_PATH` -are directories): - - $ docker exec foo tar Ccf $(dirname SRC_PATH) - $(basename SRC_PATH) | tar Cxf DEST_PATH - - -or +running `tar` in `docker exec`. Both of the following examples do the same thing +in different ways (consider `SRC_PATH` and `DEST_PATH` are directories): - $ tar Ccf $(dirname SRC_PATH) - $(basename SRC_PATH) | docker exec -i foo tar Cxf DEST_PATH - +```bash +$ docker exec foo tar Ccf $(dirname SRC_PATH) - $(basename SRC_PATH) | tar Cxf DEST_PATH - +``` +```bash +$ tar Ccf $(dirname SRC_PATH) - $(basename SRC_PATH) | docker exec -i foo tar Cxf DEST_PATH - +``` Using `-` as the `SRC_PATH` streams the contents of `STDIN` as a tar archive. The command extracts the content of the tar to the `DEST_PATH` in container's |
