Skip to content

[Request]: Storage - Add container volume cp command to copy data to and from volumes #895

Description

@realrajaryan

Feature or enhancement request details

Add ability to copy files and directories to and from volumes without requiring a running container. This simplifies volume data management for backups, seeding data, and extraction.

Basic requirements:

  • Copy files/directories from host to volume
  • Copy files/directories from volume to host
  • Preserve file permissions and attributes
  • Support recursive directory copying

Example usage:

# Copy to volume
container volume cp /path/on/host myvolume:/path/in/volume

# Copy from volume
container volume cp myvolume:/path/in/volume /path/on/host

# Copy directory recursively
container volume cp -r /local/data myvolume:/data

This avoids the current workaround of mounting the volume to a temporary container just to copy data in and out.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added
    facet/storage
    on Nov 17, 2025
  2. PhantomInTheWire commented on Nov 19, 2025

    @PhantomInTheWire

    i could work on this

  3. realrajaryan commented on Nov 19, 2025

    @realrajaryan
    MemberAuthor

    i could work on this

    @PhantomInTheWire Thanks for picking this up! I’d suggest using this thread to discuss your approach and get some feedback before you start implementing, since there might be some caveats. This will make both development and review much smoother :)

  4. PhantomInTheWire commented on Nov 22, 2025

    @PhantomInTheWire

    hey @realrajaryan i was thinking something where data flow looks like this

    Host → Volume

    1. CLI: Create tar of local files → pipe.write
    2. CLI: Dup pipe.read FD → send to XPC
    3. Daemon: Receive FD →uncompress() → extract to volume path

    Volume → Host

    1. CLI: Dup pipe.write FD → send to XPC with copyOut request
    2. Daemon: compress() from volume path → write to FD
    3. XPC: Stream tar data back to CLI (through the FD)
    4. CLI: Read from pipe → uncompress() → extract to temp dir → move to destination

    for the compress() uncompress() i think extending Archiver.swift with func uncompress(...) and func compress(...) to handle writes to file handle(pipe).

    I was wondering if this is enough or should we also support volume to volume copies(i think it would be cool if that could happen but i think we should make that a follow up pr with a separate issue of its own)

  5. PhantomInTheWire commented on Dec 20, 2025

    @PhantomInTheWire

    hey @realrajaryan i have a pr open for this at #963 could you take a look and help review it? thanks.

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

    facet/storage

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions