Repository navigation
How to use custom host-to-IP mapping #7189
Unanswered
BenjaminQuandt
asked this question in
Q&A
Replies: 1 comment
|
Use container.withExtraHost("service.internal", "192.0.2.10");This is the Testcontainers equivalent of: docker run --add-host service.internal:192.0.2.10 ...It adds the hostname/IP mapping to the container's This API was already present in Testcontainers 1.18.3: GenericContainer source. Its implementation passes these mappings to Docker's extra-hosts configuration. AI-assisted answer, checked against the linked source; the example was not run locally. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi,
i want to use the custom host-to-IP mapping feature from docker. As docker handle the /etc/hosts file a bit special, there is a option to add those entries with the "--add-host" Flag.
see in reference:
https://docs.docker.com/engine/reference/commandline/run/
I didn't see any option to do that in testcontainers for now. Can someone explain how u should use it here?
All reactions