⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@sondavidb
Copy link
Contributor

Closes #4691

This PR should allow support for the following in container cp:

  • Specifying - in src to allow streaming the contents of a tarball into a container.
  • Specifying - in dst to allow streaming the contents of a container into a tarball that is written to stdout

- `nerdctl cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|-`
- `nerdctl cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH`

Using `-` as the `SRC_PATH` streams the contents of `STDIN` as a tar archive. The command extracts the content of the tar to the `DEST_PATH` in container's filesystem. In this case, `DEST_PATH` must specify a directory. Using `-` as the `DEST_PATH` streams the contents of the resource as a tar archive to `STDOUT`.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, copied this exact wording from https://docs.docker.com/reference/cli/docker/container/cp/#corner-cases. LMK if this is a problem in any way.

@sondavidb
Copy link
Contributor Author

sondavidb commented Jan 16, 2026

Will get to adding testing tomorrow. Having some trouble adding tests to the existing testing suite for now.

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.

Feature Request: Support stdin/stdout streaming (-) in nerdctl cp

1 participant