You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My issue is about the documentation content or website
Type of issue
Information is incorrect
Description
Docs for docker cp -a claim that -a will "Archive mode (copy all uid/gid information)"
My testing shows that this is incorrect.
It appears that docker cp . container-name:/without the -a flag will preserve ownership of the copied files. That is, a file owned by user ID 1234 on the host will be created with user ID 1234 within the container.
Adding the -a flag will instead change the ownership of copied files to match the --user of the container.
To pin down whether this is a docs bug or a code bug: historically docker cp -a (archive mode) is meant to preserve UID/GID, so your finding — that without-a ownership is preserved and with-a it's re-mapped to the container's --user — is the opposite of the documented intent and would be surprising behavior, not just a wording slip.
Could you share the docker version and a minimal repro (source file owned by a known uid, the exact docker cp invocation, and the resulting ls -l inside the container)? That'll tell us whether -a is genuinely re-mapping ownership (code bug) or whether the no--a preservation you're seeing is the quirk worth documenting. Either way the current "copy all uid/gid information" wording for -a doesn't match what you observed.
Activity
Fix incorrect documentation for `docker cp -a` flag
fix(cp): clarify --archive flag only applies when copying to container
hiSandog commentedon Jun 26, 2026
To pin down whether this is a docs bug or a code bug: historically
docker cp -a(archive mode) is meant to preserve UID/GID, so your finding — that without-aownership is preserved and with-ait's re-mapped to the container's--user— is the opposite of the documented intent and would be surprising behavior, not just a wording slip.Could you share the
docker versionand a minimal repro (source file owned by a known uid, the exactdocker cpinvocation, and the resultingls -linside the container)? That'll tell us whether-ais genuinely re-mapping ownership (code bug) or whether the no--apreservation you're seeing is the quirk worth documenting. Either way the current "copy all uid/gid information" wording for-adoesn't match what you observed.cspotcode commentedon Jun 30, 2026
Emphasis:
docs(cp): clarify -a sets ownership to the container user