testcontainers / testcontainers/testcontainers-java
[Feature]: Document and provide tooling for running testcontainers from windows (ie: intellij) using docker ce on wsl without desktop
Nessuno ha ancora preso questa issue.
- Lingua principale
- Java
- Stelle
- 8.7k
- Fork
- 1.9k
- Merge medio
- 2g 17h
- PR unite (30g)
- 9
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Leggi prima la documentazione sull’ambiente Docker supportato su Windows e il gist collegato per la configurazione di WSL2. Poi esamina core/src/main/java/org/testcontainers/utility/PathUtils.java intorno alla riga 63 per valutare la gestione richiesta dei percorsi Windows/WSL. Il lavoro è completo quando la documentazione copre Docker CE su WSL2 per IntelliJ, con qualsiasi comportamento di rilevamento della piattaforma definito chiaramente qualora si proceda con il tooling.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- docker, java, linux
- Ambito
- documentation, tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100