Automatically map exposed ports defined in Dockerfile
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 30/100
調査の方向性
まず GenericContainer とその withExposedPorts の処理を読み、次に issue で説明されているエントリーポイント DockerClientFactory.instance().client().inspectImageCmd(...) を調べます。GenericContainer がポートを指定しなかった場合にイメージから公開ポートを導出でき、同時に issue の明示的なポートの場合とポートなしの場合が引き続き定義され、検証されていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Typically a Docker image will declare what ports it exposes using:
EXPOSE <ports...>
Why is it also necessary to duplicate this information by default for GenericContainer?
Take the quick start example:
@Rule
public GenericContainer redis = new GenericContainer<>("redis:5.0.3-alpine")
.withExposedPorts(6379);
If the user does not explicitly state what ports to expose via withExposedPorts(), could we run DockerClientFactory.instance().client().inspectImageCmd(this.getDockerImageName()).exec(); to run a Docker image inspection and automatically read/set the ports exposed by the Docker image? I know there are situations where a user may not want to expose all (or any) ports of a container, but I think this would be the minority case for Testcontainers users, right?
If we were to do this, the above code example could simply be:
@Rule
public GenericContainer redis = new GenericContainer<>("redis:5.0.3-alpine");
- 主要言語
- Java
- スター
- 8.7k
- フォーク
- 1.9k
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 9
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
testcontainers/testcontainers-java のほかの issue
-
type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
testcontainers/testcontainers-java#11997 · コメント 1 件 ·
-
[Enhancement]: Document why singleton containers are required under Spring's test context caching オープンtype/enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
testcontainers/testcontainers-java#11967 ·
-
type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
testcontainers/testcontainers-java#11941 ·
-
type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
testcontainers/testcontainers-java#11829 · コメント 1 件 ·
-
type/enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
testcontainers/testcontainers-java#11578 ·
testcontainers/testcontainers-java の issue をすべて見る
似ている issue
-
Bug Java Platform: Java
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
getsentry/sentry-java#6138 · コメント 1 件 ·
-
bug needs triage p2
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
GoogleCloudPlatform/DataflowTemplates#4273 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
bug needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100