Open AndreasEK opened 3 months ago
I would also like to use this feature. I have exactly the same use-case as @AndreasEK. Having to provide the env variable every time is very inconvenient (especially in the IDE).
By the way, it's already implemented in testcontainers-dotnet
. See docker.socket.override
and host.override
options in this table: Custom Configuration.
Happy to implement this one if maintainers agree that it is a good idea.
+1, I think the problem is in this piece: https://github.com/testcontainers/testcontainers-java/blob/main/core/src/main/java/org/testcontainers/DockerClientFactory.java#L164-L168
In String dockerSocketOverride = System.getenv("TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE");
, it only takes env vars as consideration. Hope it will check some fields in DockerClientProviderStrategy
as well, currently EnvironmentAndSystemPropertyClientProviderStrategy
just ignores docker.socket.override
...
I think it just a bug...
Module
Core
Proposal
When I understood these correctly:
… on mac with colima, the environment variable
TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE
is required.This is a nuicance, when acceptance tests are run from the IDE, since then every run configuration has to include this env variable, or maybe you would have to create a template for it, etc. I tried to work around that situation by using
~/.testcontainers.properties
for it, but only when I set the actual environment variable, the tests work fine.Running Integration Tests only with properties
With only the
~/.testcontainers.properties
in place, ryuk cannot be detected:Running Integration Tests with TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE
After exporting
TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE
connection is refused:Running Integration Tests with TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE & TESTCONTAINERS_HOST_OVERRIDE