Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/command/container/cp.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ container source to stdout.`,

flags := cmd.Flags()
flags.BoolVarP(&opts.followLink, "follow-link", "L", false, "Always follow symbol link in SRC_PATH")
flags.BoolVarP(&opts.copyUIDGID, "archive", "a", false, "Archive mode (copy all uid/gid information)")
flags.BoolVarP(&opts.copyUIDGID, "archive", "a", false, "Archive mode (set ownership to match the container user)")
flags.BoolVarP(&opts.quiet, "quiet", "q", false, "Suppress progress output during copy. Progress output is automatically suppressed if no terminal is attached")
return cmd
}
Expand Down
2 changes: 1 addition & 1 deletion contrib/completion/fish/docker.fish
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ complete -c docker -A -f -n '__fish_seen_subcommand_from commit' -a '(__fish_pri

# cp
complete -c docker -f -n '__fish_docker_no_subcommand' -a cp -d "Copy files/folders between a container and the local filesystem"
complete -c docker -A -f -n '__fish_seen_subcommand_from cp' -s a -l archive -d 'Archive mode (copy all uid/gid information)'
complete -c docker -A -f -n '__fish_seen_subcommand_from cp' -s a -l archive -d 'Archive mode (set ownership to match the container user)'
complete -c docker -A -f -n '__fish_seen_subcommand_from cp' -s L -l follow-link -d 'Always follow symbol link in SRC_PATH'
complete -c docker -A -f -n '__fish_seen_subcommand_from cp' -l help -d 'Print usage'

Expand Down
12 changes: 5 additions & 7 deletions docs/reference/commandline/container_cp.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ container source to stdout.

| Name | Type | Default | Description |
|:----------------------|:-------|:--------|:-------------------------------------------------------------------------------------------------------------|
| `-a`, `--archive` | `bool` | | Archive mode (copy all uid/gid information) |
| `-a`, `--archive` | `bool` | | Archive mode (set ownership to match the container user) |
| `-L`, `--follow-link` | `bool` | | Always follow symbol link in SRC_PATH |
| `-q`, `--quiet` | `bool` | | Suppress progress output during copy. Progress output is automatically suppressed if no terminal is attached |

Expand All @@ -41,12 +41,10 @@ relative paths as relative to the current working directory where `docker cp` is
run.

The `cp` command behaves like the Unix `cp -a` command in that directories are
copied recursively with permissions preserved if possible. Ownership is set to
the user and primary group at the destination. For example, files copied to a
container are created with `UID:GID` of the root user. Files copied to the local
machine are created with the `UID:GID` of the user which invoked the `docker cp`
command. However, if you specify the `-a` option, `docker cp` sets the ownership
to the user and primary group at the source.
copied recursively with permissions preserved if possible. By default, ownership
(uid/gid) of the copied files is preserved from the source. If you specify the
`-a` option, `docker cp` sets the ownership to match the user and primary group
of the container (as configured with `--user`).
If you specify the `-L` option, `docker cp` follows any symbolic link
in the `SRC_PATH`. `docker cp` doesn't create parent directories for
`DEST_PATH` if they don't exist.
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/commandline/cp.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ container source to stdout.

| Name | Type | Default | Description |
|:----------------------|:-------|:--------|:-------------------------------------------------------------------------------------------------------------|
| `-a`, `--archive` | `bool` | | Archive mode (copy all uid/gid information) |
| `-a`, `--archive` | `bool` | | Archive mode (set ownership to match the container user) |
| `-L`, `--follow-link` | `bool` | | Always follow symbol link in SRC_PATH |
| `-q`, `--quiet` | `bool` | | Suppress progress output during copy. Progress output is automatically suppressed if no terminal is attached |

Expand Down