Skip to content

[Request]: Add container cp command to copy files into and out of running containers #232

@euanh

Description

@euanh

Feature or enhancement request details

Many container runtimes offer a cp command which can copy files into and out of running containers.

Usually the cp command has a few of main modes of operation:

  • copy a single file in or out of the container
  • recursively copy a directory in or out of the container
  • create a tar archive of a path in the container and stream it out to the host, or receive a tar stream from the host and unpack it in the container

There are also often options to control the details of how symlinks and permissions are handled.

Swift SDK Generator currently relies on the tar streaming mode to extract Swift SDKs from container images: Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator.swift#L122

It's possible to work around the lack of cp by execing tar in the container image and piping the output to tar on the host, however this isn't a general solution because the container might not have a tar binary.

Code of Conduct

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    nextMust-have items for current and next milestone

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions