Conversation
core/src/main/java/org/testcontainers/dockerclient/RootlessDockerClientProviderStrategy.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/testcontainers/utility/ResourceReaper.java
Outdated
Show resolved
Hide resolved
| @Test | ||
| public void shouldReportOOMAfterWait() { | ||
| Info info = DockerClientFactory.instance().client().infoCmd().exec(); | ||
| // Poor man's rootless Docker detection :D |
There was a problem hiding this comment.
😂 for our tests, could we do this using the host socket URI?
There was a problem hiding this comment.
I didn't want to do string matching, especially given that the feature is experimental and may change the socket location.
Apparently, Docker returns rootless security capability from the info endpoint, just docker-java does not expose it (yet). I will add it to docker-java, so that we can remove this workaround, okay? :)
There was a problem hiding this comment.
Cool, I was wondering if that would be the case. Let's not hold up this PR for the change in docker-java, though - it's OK as-is.
| @Deprecated | ||
| public final class RootlessDockerClientProviderStrategy extends DockerClientProviderStrategy { | ||
|
|
||
| public static final int PRIORITY = EnvironmentAndSystemPropertyClientProviderStrategy.PRIORITY + 20; |
There was a problem hiding this comment.
Do we want this to be the highest priority? I'd put this lower than UnixSocketClientProviderStrategy, at least after #1771 is merged (so that DOCKER_HOST is always respected, non-rootless-docker is tried first, and automatically configured rootless docker is tried last of all)
There was a problem hiding this comment.
I didn't want rootless DOCKER_HOST to take precedence (because we need to override the host ip) but yeah, I see what you mean.
I will make it have lower priority, but ensure that EnvAndSysPropsStrategy does not detect rootless host that easily
There was a problem hiding this comment.
update:
with overridable host, it is no longer a problem when EnvAndSysPropsStrategy detects the rootless DOCKER_HOST
docs/features/configuration.md
Outdated
|
|
||
| However, sometimes a customization is required. For that, you can provide the following environment variables: | ||
|
|
||
| > **TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE = /var/run/docker-alt.sock** |
There was a problem hiding this comment.
Could we make these match the format of other configuration settings, where we show what the default value is?
There was a problem hiding this comment.
We could, but there is no default value, so I am not sure what to use :D
Closes #2943, #1770