Skip to content

fix(cp): Copy from container to local with multiple sources#6990

Open
yasapurnama wants to merge 1 commit into
docker:masterfrom
yasapurnama:master
Open

fix(cp): Copy from container to local with multiple sources#6990
yasapurnama wants to merge 1 commit into
docker:masterfrom
yasapurnama:master

Conversation

@yasapurnama
Copy link
Copy Markdown

Description

Allow docker cp to accept multiple source paths when the destination is a directory.
This fixes commands where shell brace expansion produces multiple source arguments, for example:

docker cp container:/home/ubuntu/{backup.tar.gz,settings.json} ~/Downloads/backups

Previously this failed because docker cp required exactly two arguments.

Changes

  • Accept two or more positional arguments for docker cp
  • Treat the last argument as the destination
  • Validate that multi-source copies use a directory destination
  • Copy each source sequentially using existing copy logic
  • Add unit coverage for multi-source command and runCopy paths

@yasapurnama yasapurnama marked this pull request as draft May 15, 2026 02:29
@yasapurnama yasapurnama marked this pull request as ready for review May 15, 2026 02:30
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.

1 participant