By default it is possible to access host services on host external interfaces (not loopback). Host is available under IP address of Docker network, so dynamic mapping is needed (address can change).
Docker can automatically generate /etc/hosts
to provide name resolution of other containers.
This can be extended by:
docker run --add-host=host.docker.internal:host-gateway
extra_hosts: - "host.docker.internal:host-gateway"
List of usefull DNS aliases:
NOTE: Supported in Docker version 20.10.0
Using host network mode exposes host network stack do container!