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

未关闭
#8,370 0 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
docker, java, linux

调研方向

首先阅读受支持的 Windows Docker 环境文档以及链接的 WSL2 设置 gist。然后检查 core/src/main/java/org/testcontainers/utility/PathUtils.java 第 63 行附近的代码,以评估所要求的 Windows/WSL 路径处理。完成的标准是:文档涵盖适用于 IntelliJ 的 WSL2 上的 Docker CE,并且如果继续开发 tooling,则明确规定任何平台检测行为。

由索引模型根据 Issue 内容生成。

描述

type/feature
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

主要语言
Java
星标
8.7k
派生
1.9k
平均合并
2 天 17 小时
30 天内合并 PR
9

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

testcontainers/testcontainers-java 的其他 Issue

查看 testcontainers/testcontainers-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。