I have services defined in my own docker-compose.yaml
file, and they
have their own bridged network to communicate with each other.
One of this services needs access to services running on the host machine.
According to this answer I added the following lines to my service within the docker-compose.yaml
file:
extra_hosts:
- "host.docker.internal:host-gateway"
This works, despite the fact that the services running on the host need to bind to 0.0.0.0
. If I bind to localhost
, I'm not able to access them. But I don't want to expose the port to anyone else.
Is there a way to achieve this with bridged network mode?
I'm using the following versions:
- Docker version 20.10.5, build 55c4c88
- docker-compose version 1.28.5, build unknown
and I'm running on aarch64