Address Compose containers by service name
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- docker-compose, typescript
- 領域
- devtools, testing-qa
調査の方向性
Start by reading packages/testcontainers/src/docker-compose-environment/docker-compose-environment.ts and started-docker-compose-environment.ts, then trace the compose name parsing entry point in packages/testcontainers/src/docker-runtime/clients/compose/parse-compose-container-name.ts. Check how containers are identified and how wait strategies and getContainer resolve them; done means those APIs accept service names with an optional replica index while retaining container-name support, and the constructor parameter is named for the directory it receives.
索引モデルが issue の本文から書いたものです。
説明
What happens
DockerComposeEnvironment identifies containers by container name, not by the service name written in the compose file:
const environment = await new DockerComposeEnvironment(dir, "docker-compose.yml")
.withWaitStrategy("redis-1", Wait.forLogMessage("Ready to accept connections"))
.up();
const redis = environment.getContainer("redis-1");
- The
-1suffix is a Compose naming detail the user has to know. - A service with
container_name:set is keyed by that name instead. - A wait strategy registered under the service name (
"redis") matches nothing.up()now logs a warning for that case, and the docs carry a callout, but the default wait strategy is still what runs. getContainer("redis")throwsCannot get container "redis" as it is not running.
The first constructor parameter is also misnamed: composeFilePath is the directory that contains the compose files, and the docs assign it "/path/to/build-context".
Expected
withWaitStrategyandgetContaineraccept a service name, with an optional replica index, and keep accepting a container name.- The constructor parameter is named for what it is.
Where
packages/testcontainers/src/docker-compose-environment/docker-compose-environment.tspackages/testcontainers/src/docker-compose-environment/started-docker-compose-environment.tspackages/testcontainers/src/container-runtime/clients/compose/parse-compose-container-name.ts
Notes
- Java uses service names throughout:
waitingFor(serviceName, strategy),getServiceHost(serviceName, port),getContainerByServiceName(serviceName), with an optional instance number onwithExposedService. Go hasServiceContainer(ctx, svcName)andWaitForService(name, strategy). - Compose labels each container with
com.docker.compose.serviceandcom.docker.compose.container-number, so resolving a service does not need name parsing. - Related: #647.
Dependencies
- Nothing blocks this. It can start now.
- 主要言語
- TypeScript
- スター
- 2.6k
- フォーク
- 277
- 平均マージ
- 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
-
難易度 1/5 1時間未満 初心者へのやさしさ 83/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ranxianglei/billion-context#3583 ·
メンテナーはふだん 1 日以内に返信
-
bug:new
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
callstackincubator/simlock#673 ·
メンテナーはふだん 1 日以内に返信
-
documentation v3
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
anomalyco/opencode#56380 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信