Skip to content

Feature: Stream bytes out on copy_from_container #1149

Open

Description

@ikmckenz

What are you trying to do?

In Testcontainers Java, there's a handy override for copyFileFromContainer() that let's you pass a function to collect the output stream. This seems to be primarily exist so you can stream the bytes out without writing them to disk.

In Testcontainers Go, CopyFileFromContainer() returns an io.ReadCloser directly which is super nice.

It would be handy if there was a way to do this in the python version, which currently only supports passing a Path and writing to that path.

Why should it be done this way?

I don't want to use a temporary file on disk.

Other references:
https://golang.testcontainers.org/features/files_and_mounts/

https://github.com/testcontainers/testcontainers-java/blob/e16dca9ea8e8b097c7b15aa8f420cee0a1b16687/core/src/main/java/org/testcontainers/containers/ContainerState.java#L404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions