docs: clarify usage of TESTCONTAINERS_HOST_OVERRIDE
for DinD on Docker Desktop
#6383
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While #6282 tried to clarify the usage of Testcontainers in DinD setups on Docker Desktop (based and what we learned about using
docker.sock.raw
from this comment in Docker Desktop), we actually learned that this won't work when running a DinD setup on Docker Desktop using Docker Compose V2 (this holds true on Mac and on Windows). While we are not sure about the root cause that makes sibling containers inaccessible using the default gateway, we suspect that is can be related to the default Docker Compose network.However, we identified that configuring
TESTCONTAINERS_HOST_OVERRIDE
to usedocker.host.internal
provides a stable experience in all scenarios. Since using DinD requires some manual configuration in the first place, it does not really matter if we have to manually touch the config to use the raw socket or instead use the override, so we can document the widely stable approach instead.This means, we can also close #4396 now, since this behavior for host ort 0 was an accidental background as outlined by Docker in the comment mentioned above and we now have a good workaround for Docker Desktop.