Skip to content

Ability to read a file from the container by chunks #575

Description

@ianfixes

This function will read the contents of a file from a DockerContainer:
https://github.com/swipely/docker-api/blob/a322b83e44a8e46a70a166a6c84a0b8d1080ddfe/lib/docker/container.rb#L300-L313

However, it returns them as a string. Can a variant of this be added such that (if a block is given) a function such as archive_out_stream can be used to pass the un-tarred file contents to a given block, chunk by chunk? I'm concerned that opening large files in this way will cause out-of-memory issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions