testcontainers / testcontainers/testcontainers-java

[Feature]: Document and provide tooling for running testcontainers from windows (ie: intellij) using docker ce on wsl without desktop

オープン
#8,370 コメント 0 件 リアクション 4 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

type/feature
主要言語
Java
スター
8.7k
フォーク
1.9k
平均マージ
2日 17時間
マージ済み PR(30日)
9

説明

Module

None

Problem

In some corporate environments, the use of docker desktop is not allowed due to licensing issues. However, docker community edition running on wsl2 is supported. It is possible to run docker on wsl2, and connect to it from intellij following the steps noted in this gist: https://gist.github.com/sz763/3b0a5909a03bf2c9c5a057d032bd98b7 . Additionally, if a container needs to access the filesystem, this is nice https://github.com/testcontainers/testcontainers-java/blob/main/core/src/main/java/org/testcontainers/utility/PathUtils.java#L63 but insufficient, because on the WSL side it needs to be prepended with /mnt (assuming the path is something like /c/parentdir/targetdir .

Solution
  • enhance the documentation here: https://java.testcontainers.org/supported_docker_environment/windows/ to also mention how to run testcontainers without docker desktop
  • possibly autodetect platform and enable calling the mingw path utility and prepending/mnt depending on platform detected (look at environment variables, possibly have an environment variable to signal that wsl is being used as the docker host)
Benefit

Windows IDE users who cannot get a docker desktop license will not be excluded from writing good tests.

Alternatives

Users are currently able to run testcontainers without docker desktop on windows, but have to scrounge around the internet for information. Some IDEs can run natively in wsl2, but especially for IDEs like intellij this is a tricky, painful process.

Would you like to help contributing this feature?

Yes

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

まず、Windows でサポートされている Docker 環境のドキュメントと、リンクされている WSL2 セットアップ用 gist を読んでください。次に、要求されている Windows/WSL パス処理を評価するため、core/src/main/java/org/testcontainers/utility/PathUtils.java の 63 行目付近を調査してください。完了の条件は、ドキュメントが IntelliJ 向けの WSL2 上の Docker CE を扱っており、tooling を進める場合にはプラットフォーム検出の動作が明確に定義されていることです。

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

評価

技術スタック
docker, java, linux
領域
documentation, tooling
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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