Tschasmine / geoLocation

abas App GeoLocation
0 stars 0 forks source link

Docker Environment fix for Windows #11

Open Xedon opened 6 years ago

Xedon commented 6 years ago

I tried to get the publishJar tasks to work properly on Docker for Windows. If i used the containers name i got every time hostname "nexus" unknown and if i tried my laptops hostname i got "Connection refused" -> firewall was off.

So I had to add this 2 lines on the erp service in the docker-compose.yml: links:

There must be some errors with container hostname sharing cause the erp container should know the nexus container by default because they are in the same network.

Tschasmine commented 6 years ago

I don't quite get where you tried to use "nexus" as hostname? In your gradle.properties file? The containers can see each other and can also be seen from the machine the containers run on, to ensure the containers can see each other, you need to use your IP address (or if using docker-machine the docker-machine's IP address) as hostname instead of localhost. If I misunderstood your question, please specify.

Xedon commented 6 years ago

172.18.0.1 Windows? 172.18.0.2 Nexus 172.18.0.3 abas

Ok my problem was that i used the ip Address 172.18.0.1 or 172.18.0.2 with that IP Addresses i can connect from the abas container to the nexus container but on windows i cant connect with that ip Addresses to the nexus Container. So i needed a workaround, with the nexus hostname on abas pointing to nexus and on windows side pointing to localhost because docker binds the container ports to localhost in docker for windows.