testcontainers / testcontainers/testcontainers-java
[Bug]: the newcomer example immediately turns into troubleshooting
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 8.7k
- Forks
- 1.9k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 9
Description
Module
PostgreSQL
Testcontainers version
1.18.0
Using the latest Testcontainers version?
Yes
Host OS
Microsoft Windows [Version 10.0.19045.3570]
Host Arch
amd64
Docker version
Docker version 24.0.6, build ed223bc
What happened?
As a newcomer,
I installed docker Desktop for Windows.
Following https://testcontainers.com/guides/getting-started-with-testcontainers-for-java/ got error:
[INFO] -------------------------------------------------------
[INFO] Running com.testcontainers.demo.[1mCustomerServiceTest[m
15:14:48.055 [main] DEBUG org.testcontainers.utility.TestcontainersConfiguration -- Testcontainers configuration overrides will be loaded from file:/C:/Users/ppku/.testcontainers.properties
15:14:48.071 [main] WARN org.testcontainers.utility.TestcontainersConfiguration -- Attempted to read Testcontainers configuration file at file:/C:/Users/ppku/.testcontainers.properties but the file was not found. Exception message: FileNotFoundException: C:\Users\ppku\.testcontainers.properties (The system cannot find the file specified)
15:14:48.078 [main] INFO org.testcontainers.utility.ImageNameSubstitutor -- Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
15:14:48.335 [main] DEBUG org.testcontainers.dockerclient.DockerClientProviderStrategy -- Trying out strategy: NpipeSocketClientProviderStrategy
15:14:48.335 [main] DEBUG org.testcontainers.dockerclient.DockerClientProviderStrategy -- DOCKER_HOST socket file '//./pipe/docker_engine' does not exist
15:14:48.335 [main] DEBUG org.testcontainers.dockerclient.DockerClientProviderStrategy -- strategy NpipeSocketClientProviderStrategy did not pass the test
15:14:48.335 [main] INFO org.testcontainers.dockerclient.DockerMachineClientProviderStrategy -- docker-machine executable was not found on PATH ([C:/app/eclipse-2022-09//plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.4.v20220903-1038/jre/bin/server, C:/app/eclipse-2022-09//plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.4.v20220903-1038/jre/bin, C:\WINDOWS\system32, C:\WINDOWS, C:\WINDOWS\System32\Wbem, C:\WINDOWS\System32\WindowsPowerShell\v1.0\, C:\WINDOWS\System32\OpenSSH\, C:\Program Files (x86)\Pulse Secure\VC142.CRT\X64\, C:\Program Files (x86)\Pulse Secure\VC142.CRT\X86\, C:\Program Files (x86)\Symantec\VIP Access Client\, C:\Program Files\Docker\Docker\resources\bin, C:\Users\ppku\AppData\Local\Microsoft\WindowsApps, C:\Users\ppku\AppData\Local\GitHubDesktop\bin, C:\app\Microsoft VS Code\bin, C:\app\node-v18.17.1-win-x64, , C:\app\eclipse-2022-09])
15:14:48.335 [main] ERROR org.testcontainers.dockerclient.DockerClientProviderStrategy -- Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
As no valid configuration was found, execution cannot continue.
See https://www.testcontainers.org/on_failure.html for more details.
Following the on failure link has not helped a lot.
There must be missing some trivial assumption. If I start PowerShell I get:
PS C:\Users\ppku> docker --version
Docker version 24.0.6, build ed223bc
so docker is on path.
Quite not understand why probing failed.
Could you investigate, pls?
Relevant log output
No response
Additional Information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the getting-started-with-testcontainers-for-java guide and the linked on_failure documentation, then reproduce the Windows Docker Desktop setup using the reported logs. Trace why the example cannot find a valid Docker environment; done means the newcomer example runs successfully or the guide clearly documents the missing prerequisite and troubleshooting step.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, java, postgresql
- Domain
- devops, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100