withExtraHost method
Adds host with address to the container's hosts file; the
address host-gateway is the machine the daemon runs on
(withExtraHost('host.docker.internal', 'host-gateway') makes that
name work on Linux as it does on Docker Desktop).
Testcontainers (Java): withExtraHost(host, address).
Implementation
GenericContainer withExtraHost(String host, String address) {
_extraHosts.add('$host:$address');
return this;
}