Skip to content

[Docker Compatibility] Missing stdin/stdout streaming (-) in finch cp #1661

@tinovyatkin

Description

@tinovyatkin

Summary

Finch's cp command does not support using - (dash) for streaming tar archives via stdin/stdout. This feature is available in Docker CLI and is essential for efficient file transfer in development tooling.

Upstream Issue

This is an nerdctl limitation tracked at: containerd/nerdctl#4691

Docker Behavior

# Stream tar archive into container
cat archive.tar | docker cp - container:/path/

# Stream container contents to stdout
docker cp container:/var/log/app.log - | tar x -O | grep "ERROR"

Podman Compatibility

Podman fully supports stdin/stdout streaming with - in the cp command.

Impact

This gap affects tools that transfer files to/from containers:

  • VS Code Docker extension (uses stdin streaming to write files efficiently)
  • Backup/restore operations
  • CI/CD pipelines injecting configs or extracting artifacts

Workaround

A workaround for VS Code Docker extension is implemented in PR #327 that:

  • Uses shell commands with tar and mktemp for file operations
  • Creates temporary files for write operations
# Read workaround
finch cp container:/path - | tar -xOf -

# Write workaround (uses temp file)
TMPFILE=$(mktemp) && cat > "$TMPFILE" && finch cp "$TMPFILE" container:/path && rm -f "$TMPFILE"

Suggested Action

Consider contributing the implementation upstream to nerdctl to maintain Docker CLI compatibility.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions