Make an image built from a Dockerfile usable with modules
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- docker, typescript
- 領域
- devtools
調査の方向性
Read packages/testcontainers/src/generic-container/generic-container-builder.ts and the fromDockerfile implementation in packages/testcontainers/src/generic-container/generic-container.ts; check issues #1527 and #1518 for overlapping changes. Trace how the builder names and returns an image, then inspect container construction and types. Done when the options object and build result work as described, existing GenericContainer.fromDockerfile(...).build() remains usable, and the listed API cases type-check.
索引モデルが issue の本文から書いたものです。
説明
What happens
GenericContainer.fromDockerfile(context).build() resolves to a GenericContainer. The image it built is only reachable through that one object:
- The image name is held in a protected field, so it cannot be read back.
- A module cannot use it. To run a custom Postgres image with
PostgreSqlContainer, the image has to be given an explicit name and that name repeated:
await GenericContainer.fromDockerfile(context).build("my-postgres:test", { deleteOnExit: true });
const container = await new PostgreSqlContainer("my-postgres:test").start();
PostgreSqlContainer.fromDockerfile(...)type-checks, because the static is inherited, but still returns a plainGenericContainer.
build(image?, options?) is awkward on its own terms:
- The image name is positional and comes first, so setting
deleteOnExitmeans supplying an image name too. BuildOptionsis{ deleteOnExit: boolean }with its only field required.- The builder class is named
GenericContainerBuilder, although what it builds is an image.
Expected
Building an image and choosing a container class are separate steps:
build()takes an options object,build({ image, deleteOnExit }).- A build result that exposes the image name, for example
const image = await ImageBuilder.fromDockerfile(context).build(); image.getName(). - Container constructors accept that result as well as a string, so
new PostgreSqlContainer(image)works. GenericContainer.fromDockerfile(...).build()keeps working.
Where
packages/testcontainers/src/generic-container/generic-container-builder.tsfromDockerfileinpackages/testcontainers/src/generic-container/generic-container.ts
Notes
- Java's
GenericContainerhas a constructor that takes aFuture<String>image, which is hownew GenericContainer(new ImageFromDockerfile()...)works: the build is a value passed to a container.
Dependencies
- Nothing blocks this. It can start now.
- Coordinate with #1527: both touch
GenericContainerBuilder(withBuildArgs). - Coordinate with #1518: for the positional
build(image, options)form.
- 主要言語
- TypeScript
- スター
- 2.6k
- フォーク
- 274
- 平均マージ
- 1日 14時間
- マージ済み PR(30日)
- 44
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
testcontainers/testcontainers-node のほかの issue
-
enhancement minor
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
testcontainers/testcontainers-node#1539 ·
メンテナーはふだん 1 日以内に返信
-
enhancement minor
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
testcontainers/testcontainers-node#1533 ·
メンテナーはふだん 1 日以内に返信
-
enhancement minor
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
testcontainers/testcontainers-node#1531 ·
メンテナーはふだん 1 日以内に返信
-
enhancement minor
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
testcontainers/testcontainers-node#1529 ·
メンテナーはふだん 1 日以内に返信
-
enhancement minor
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
testcontainers/testcontainers-node#1528 ·
メンテナーはふだん 1 日以内に返信
testcontainers/testcontainers-node の issue をすべて見る
似ている issue
-
fix(frontend): correct VITE_IS_DEVELPOMENT typo in shared/app.ts and align dev environment flagsオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
vicharanashala/ajrasakha#1439 ·
メンテナーはふだん 1 日以内に返信
-
Add: TV5Monde Asieオープンapproved check:passed streams:add
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
codex-team/editor.js#3037 ·
-
complexity: trivial good first issue impact: low
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
ueberdosis/tiptap#8522 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
wormhole-foundation/wormhole#5062 ·
メンテナーはふだん 1 日以内に返信