Skip to content

docker cp -a docs incorrect #17533

Open
Open

Description

@cspotcode

Is this a docs issue?

  • 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.

Location

https://docs.docker.com/engine/reference/commandline/cp/

Suggestion

No response

Activity

  1. thaJeztah commented on Jun 12, 2023

    @thaJeztah
    Member
  2. added
    area/engine
    on Jun 12, 2023
  3. cspotcode commented on Jun 12, 2023

    @cspotcode
    Author

    A user would intuitively expect docker cp's --archive flag to enable something similar to Unix's cp -a but, in fact, it disables a behavior of cp -a.

    What is the intended, bug-free behavior? Docker cp preserves everything except ownership, and -a enables ownership preservation? This means docker cp is not quite like unix cp nor cp -a

  4. docker-robot commented on Sep 10, 2023

    @docker-robot

    There hasn't been any activity on this issue for a long time.
    If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment.
    If not, this issue will be closed in 14 days. This helps our maintainers focus on the active issues.

    Prevent issues from auto-closing with a /lifecycle frozen comment.

    /lifecycle stale

  5. cspotcode commented on Sep 10, 2023

    @cspotcode
    Author

    /remove-lifecycle stale

  6. docker-robot commented on Dec 9, 2023

    @docker-robot

    There hasn't been any activity on this issue for a long time.
    If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment.
    If not, this issue will be closed in 14 days. This helps our maintainers focus on the active issues.

    Prevent issues from auto-closing with a /lifecycle frozen comment.

    /lifecycle stale

  7. cspotcode commented on Dec 9, 2023

    @cspotcode
    Author

    /remove-lifecycle stale

  8. docker-robot commented on Mar 15, 2024

    @docker-robot

    There hasn't been any activity on this issue for a long time.
    If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment.
    If not, this issue will be closed in 14 days. This helps our maintainers focus on the active issues.

    Prevent issues from auto-closing with a /lifecycle frozen comment.

    /lifecycle stale

  9. cspotcode commented on Mar 15, 2024

    @cspotcode
    Author

    /remove-lifecycle stale

  10. 15 remaining items

  11. cspotcode commented on Mar 10, 2025

    @cspotcode
    Author
  12. docker-robot commented on Jun 8, 2025

    @docker-robot

    There hasn't been any activity on this issue for a long time.
    If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment.
    If not, this issue will be closed in 14 days. This helps our maintainers focus on the active issues.

    Prevent issues from auto-closing with a /lifecycle frozen comment.

    /lifecycle stale

  13. cspotcode commented on Jun 8, 2025

    @cspotcode
    Author
  14. added
    agent/triaged
    agent/skip
    on Mar 19, 2026
  15. dvdksn commented on Mar 19, 2026

    @dvdksn
    Contributor

    Verdict: UPSTREAM — The docker cp CLI reference is generated from data/cli/engine/docker_container_cp.yaml, which is vendored from the docker/cli repository; any documentation fix must go to that upstream repo.

  16. cspotcode commented on Mar 19, 2026

    @cspotcode
    Author

    I've filed this issue on docker/cli: docker/cli#6870

  17. github-actions commented on Sep 16, 2026

    @github-actions
    Contributor

    There hasn't been any activity on this issue for a long time. If the problem is still relevant, add a comment to keep it open. Otherwise, this issue will be automatically closed in 14 days.

    To remove the stale label: Comment /lifecycle active
    To freeze (requires write access): Comment /lifecycle frozen

  18. cspotcode commented on Sep 16, 2026

    @cspotcode
    Author

    /lifecycle active

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/skipagent/triagedarea/enginestatus/triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions