testcontainers / testcontainers/testcontainers-python
Bug: Testcontainers in Docker container
未关闭
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 2.3k
- 派生
- 386
- 平均合并
- 4 小时 40 分钟
- 30 天内合并 PR
- 1
描述
method get_container_host_ip(self) in testcontainers/core/container.py
have the following code commented (you drive me crazy) and should be uncommented
# # check testcontainers itself runs inside docker container
# if inside_container() and not os.getenv("DOCKER_HOST") and not host.startswith("http://"):
# # If newly spawned container's gateway IP address from the docker
# # "bridge" network is equal to detected host address, we should use
# # container IP address, otherwise fall back to detected host
# # address. Even it's inside container, we need to double check,
# # because docker host might be set to docker:dind, usually in CI/CD environment
# gateway_ip = self.get_docker_client().gateway_ip(self._container.id)
# if gateway_ip == host:
# return self.get_docker_client().bridge_ip(self._container.id)
# return gateway_ip
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 testcontainers/core/container.py 中的 get_container_host_ip(self) 开始,阅读周围的主机检测逻辑以及已注释的 Docker-in-Docker 分支。检查现有的容器主机解析测试,然后验证该分支处于启用状态,并且预期的主机 IP 或网桥 IP 行为已被覆盖。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- docker, python
- 领域
- devops, testing
- Issue 类型
- 缺陷
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 35/100