Skip to content

docs(cp): clarify -a sets ownership to the container user - #7173

Open
locker95 wants to merge 1 commit into
docker:masterfrom
locker95:docs/cp-archive-ownership
Open

docs(cp): clarify -a sets ownership to the container user#7173
locker95 wants to merge 1 commit into
docker:masterfrom
locker95:docs/cp-archive-ownership

Conversation

@locker95

Copy link
Copy Markdown

docker cp -a was documented as "copy all uid/gid information", which reads like it preserves source ownership. Looking at the daemon path (copyUIDGIDapplyTarCopyUserOptions), -a actually remaps ownership to the container user; without it, source uid/gid from the tar are kept.

Updated the flag help and the generated reference text to match that.

Fixes #6870

Default docker cp keeps source uid/gid. -a/--archive remaps
ownership to the container's user instead of "preserving all
uid/gid information" as the old wording suggested.

Fixes docker#6870

Signed-off-by: Dean Chen <862469039@qq.com>
@locker95
locker95 requested review from a team and thaJeztah as code owners August 11, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docker cp -a docs incorrect

1 participant