Software environment:
Windows 11
WSL2 + ubuntu 22.04 running under it
Docker Desktop v4.28.0 – integration with WSL and Ubuntu distribution included
What I do:
I run the docker-compose file with my services. The network is standard, bridge by default. Services are up normally, everything is working. Services are issued addresses from the subnet 172.19.0.0/16 (gateway – 172.19.0.1)
Description of the problem:
From the host machine (i.e. under Windows), running containers are not available for interaction via their network addresses from the network 172.19.0.0/16 (visible only via 127.0.0.1 and those ports that are specified for forwarding in docker-compose.yaml file). The host machine is accessible from inside the containers (for example, they interact with the DBMS running on it).
Question: what actions need to be taken to see containers by their network addresses from the host machine? I need this for ease of development, when some of the services run in Docker, and some on the host machine, but… interaction between services is carried out through Service Discovery, then the services are registered in it under their real addresses and are inaccessible from the host system.