Feature: Stream bytes out on copy_from_container

オープン 初心者向け
#1,149 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

@archit15singh がすでに取り組んでいます。

2026年11月22日 から。

  • #1152 @archit15singh による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
67/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
docker, python
領域
backend

調査の方向性

まず copy_file_from_container() の Python 実装とそのテストを読んでください。issue には具体的なファイル名が記載されていません。現在の Path ベースのコピーがどのように実装されているか、また近くの API がストリームをどのように公開しているかを確認してください。一時ファイルに書き込まずに呼び出し側がコピーしたバイト列を収集でき、その新しい動作をテストでカバーできたら完了です。

索引モデルが issue の本文から書いたものです。

説明

🚀 enhancement

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

主要言語
Python
スター
2.3k
フォーク
397
平均マージ
8日 16時間
マージ済み PR(30日)
5

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

testcontainers/testcontainers-python のほかの issue

testcontainers/testcontainers-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。