[Bug]: Can't overwrite Docker socket path with 2.0.2 / Podman stopped working
維護者通常 2 天內回覆
還沒有人認領這個 Issue。
- #11255 來自 @WieczorekAdrian —— 已關閉,未合併
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 需要釐清
- 活躍度
- 停滯
- 技術堆疊
- docker, java, postgresql
- 領域
- databases, devops, testing-qa
研究方向
從日誌中顯示的 DockerClientFactory 以及 UnixSocketClientProviderStrategy 和 DockerDesktopClientProviderStrategy 項目著手。在設定 DOCKER_HOST 和 TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE 的情況下重現 PostgreSQL 整合測試,然後追蹤 Podman socket 被忽略的原因。完成的標準是 Testcontainers 2.0.2 採用已設定的 socket,且整合測試能夠成功啟動。
由索引模型根據 Issue 內容生成。
描述
Module
PostgreSQL
Testcontainers version
2.0.2
Using the latest Testcontainers version?
Yes
Host OS
Linux, Fedora 43
Host Arch
x86
Docker version
podman version
Client: Podman Engine
Version: 5.7.0
API Version: 5.7.0
Go Version: go1.25.4 X:nodwarf5
Git Commit: 0370128fc8dcae93533334324ef838db8f8da8cb
Built: Tue Nov 11 01:00:00 2025
Build Origin: Fedora Project
OS/Arch: linux/amd64
What happened?
Sorry if this is a duplicate, I wasn't able to find this issue.
I've been using Podman without any issues with the 1.x release series for years now following instructions like these. However it seems these environment variables are not respected anymore, because after upgrading some of our projects to Spring Boot 4 (which includes tc 2.0) I can't run integration tests anymore. Even after setting the following environment variables it still fails with the same message looking for /var/run/docker.sock, so something seems to be off:
DOCKER_HOST=unix:///run/user/1000/podman/podman.sock
TESTCONTAINERS_RYUK_DISABLED=true
TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=unix:///run/user/1000/podman/podman.sock
Relevant log output
13:53:24.585 [main] INFO org.testcontainers.images.PullPolicy - Image pull policy will be performed by: DefaultPullPolicy()
13:53:24.589 [main] INFO org.testcontainers.utility.ImageNameSubstitutor - Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
13:53:24.609 [main] INFO org.testcontainers.DockerClientFactory - Testcontainers version: 2.0.2
13:53:25.218 [main] INFO org.testcontainers.dockerclient.DockerMachineClientProviderStrategy - docker-machine executable was not found on PATH ([/usr/bin, /home/user/.jenv/libexec, /home/user/.sdkman/candidates/java/current/bin, /home/user/.jenv/shims, /home/user/.local/bin, /home/user/bin, /usr/local/bin, /usr/bin, /bin, /usr/local/sbin, /usr/sbin, /sbin, /var/lib/snapd/snap/bin, /home/user/go/bin, /home/user/.jenv/bin, /home/user/.npm-global/bin, /opt/go/bin])
13:53:25.220 [main] ERROR org.testcontainers.dockerclient.DockerClientProviderStrategy - Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
UnixSocketClientProviderStrategy: failed with exception InvalidConfigurationException (Could not find unix domain socket). Root cause NoSuchFileException (/var/run/docker.sock)
DockerDesktopClientProviderStrategy: failed with exception NullPointerException (Cannot invoke "java.nio.file.Path.toString()" because the return value of "org.testcontainers.dockerclient.DockerDesktopClientProviderStrategy.getSocketPath()" is null)As no valid configuration was found, execution cannot continue.
See https://java.testcontainers.org/on_failure.html for more details.
Additional Information
The only "config" we use is this line in the application-testing.yaml:
spring:
datasource:
url: jdbc:tc:postgresql:17-alpine://hostname/database
- 主要語言
- Java
- 星號
- 8.8k
- 分支
- 1.9k
- 平均合併
- 4 天 1 小時
- 30 天內合併 PR
- 7
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
testcontainers/testcontainers-java 的其他 Issue
-
[Enhancement]: Document why singleton containers are required under Spring's test context caching可能已有人在做 @zakaullah075 於 65 天前認領。 未關閉type/enhancement
難度 1/5 1 小時以內 新手友好度 85/100
testcontainers/testcontainers-java#11967 · 1 則留言 ·
維護者通常 2 天內回覆
-
[Bug]: Cannot reuse Selenium BrowserWebDriverContainers under Linux可能已有人在做 @kdelay 於 87 天前認領。 未關閉type/bug
難度 2/5 1-3 小時 新手友好度 78/100
testcontainers/testcontainers-java#11941 ·
維護者通常 2 天內回覆
-
[Bug]: DockerDesktopClientProviderStrategy is always applicable可能已有人在做 @seonwooj0810 於 136 天前認領。 未關閉type/bug
難度 2/5 1-3 小時 新手友好度 74/100
testcontainers/testcontainers-java#11829 · 1 則留言 ·
維護者通常 2 天內回覆
-
[Enhancement]: cleanup document after removing junit4 support可能已有人在做 @SJvaca30 於 143 天前認領。 未關閉type/enhancement
難度 2/5 1-3 小時 新手友好度 65/100
testcontainers/testcontainers-java#11578 ·
維護者通常 2 天內回覆
-
[Feature]: Presto Module uses the outdated Docker Image of `ghcr.io/trinodb/presto` and needs to be updated to `prestodb/presto`可能已有人在做 @linghengqian 於 826 天前認領。 未關閉help wanted type/feature
難度 2/5 1-3 小時 新手友好度 68/100
testcontainers/testcontainers-java#8657 · 4 則留言 ·
維護者通常 2 天內回覆
查看 testcontainers/testcontainers-java 的全部 Issue
相似的 Issue
-
[Bug] Lock owned by another client (e.g. Text app) cannot be unlocked from the app可能已有人在做 @falkloewert 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
bug grammar sev-0
難度 1/5 1 小時以內 新手友好度 86/100
-
難度 2/5 1-3 小時 新手友好度 76/100
-
難度 2/5 1-3 小時 新手友好度 74/100
oracle/graalvm-reachability-metadata#11026 ·
維護者通常 1 天內回覆
-
bug
難度 1/5 1 小時以內 新手友好度 88/100
維護者通常 1 天內回覆