Closed paule96 closed 1 year ago
It looks like those lines are causing the bug:
in your environment DockerEndpointAuthConfig
is likely null
(and you are using WithDockerEndpoint(...)
) then getting the schema from the endpoint will fail here:
I guess if you set the environment variable DOCKER_HOST
to a fake value like tcp://127.0.0.1:2375
before running the tests, it will work fine (workaround).
I am able to reproduce the issue. I can fix it later in the day or tomorrow. Thanks for creating the issue.
Testcontainers version
3.2.0
Using the latest Testcontainers version?
Yes
Host OS
Windows
Host arch
x86
.NET version
6.0.304
Docker version
Docker info
What happened?
If you run your testcontainers test on your windows development machine, but want to run the containers on a remote host, it is required that you have docker desktop installed and running. if you disable / uninstall it testcontainers will fail with a null reference exception. The important thing is: This happens after upgrading our solution from testcontainers
2.3.0
to testcontainers3.2.0
.our custom
IDockerEndpointAuthenticationConfiguration
looks like that:the error message that you got:
from my research so far, I'm pretty sure that the method
GetVersionAsync
inDockerSystemOperations
works wrong. It just detects the operation system by checking from the running test environment the OS. (it says windows for me, but my docker host is linux) Then the result in this method will be used to detect if the docker command will be executed against docker desktop or not inRunAsync
from the classTestcontainersClient
. this will call thenGetAndStartDefaultAsync
from the resource reaper that will fail.Relevant log output
No response
Additional information
No response