testcontainers / testcontainers/testcontainers-java
Creating Testcontainer from custom image doesn't work
まだ誰も着手していません。
- 主要言語
- Java
- スター
- 8.7k
- フォーク
- 1.9k
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 9
説明
I'm writing tests for my room-service and i need the image-service because the room-service has dependencies on the image-service. this is my file tree:
+---image-service
¦ ¦ Dockerfile
¦ ¦ pom.xml
¦ ¦
¦ +---src
¦ ¦ +---main
¦ ¦ ¦ +---java
¦ ¦ ¦ +---resources
¦ ¦ +---test
¦ ¦ +---java
¦ ¦ +---de
¦ ¦ +---fh
¦ ¦ ApplicationTest.java
+---room-service
¦ ¦ Dockerfile
¦ ¦ pom.xml
¦ ¦
¦ +---src
¦ ¦ +---main
¦ ¦ ¦ +---java
¦ ¦ ¦ +---resources
¦ ¦ +---test
¦ ¦ +---java
¦ ¦ ¦ +---de.fh
¦ ¦ ¦ ApplicationTest.java
¦ ¦ ¦
¦ ¦ +---resources
¦ ¦ application.yml
In my ApplicationTest in room-service I try to create a generic container from the dockerfile in /image-service/Dockerfile:
@BeforeClass
public static void init() {
eurekaContainer = new GenericContainer(new ImageFromDockerfile("image-service")
.withFileFromFile("./image-service", new File("../image-service/Dockerfile")));
eurekaContainer.start();
}
I couldn't find any use cases like this in the documentation.
Am I using the wrong method? Are any of the paths I used wrong?
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
room-service/src/test/java/.../ApplicationTest.java と参照されている image-service/Dockerfile から始めます。ImageFromDockerfile と withFileFromFile がパスをどのように解決するかを確認し、room-service のテストを実行します。カスタムイメージがビルドされ、コンテナが正常に起動すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- docker, java
- 領域
- devops, testing
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100