testcontainers / testcontainers/testcontainers-java

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

Offen
#8,370 0 Kommentare 4 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

type/feature
Vorherrschende Sprache
Java
Sterne
8.7k
Forks
1.9k
Ø Merge
2 T. 17 Std.
Gemergte PRs (30 T.)
9

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Lies zuerst die Dokumentation zur unterstützten Windows-Docker-Umgebung und das verlinkte WSL2-Setup-Gist. Untersuche anschließend core/src/main/java/org/testcontainers/utility/PathUtils.java ungefähr in Zeile 63, um die angeforderte Windows/WSL-Pfadbehandlung zu bewerten. Als abgeschlossen gilt dies, wenn die Dokumentation Docker CE unter WSL2 für IntelliJ abdeckt und jedes Verhalten zur Plattformerkennung klar definiert ist, falls Tooling verfolgt wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
docker, java, linux
Bereich
documentation, tooling
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.