I am trying to build an application that can control dockers containers hosted on Docker for windows.
The application is built on top of docker-java library and it works fine.
I tried to host this application on docker itself. Hosting was OK. The issue is that, when the application tries to connect to tcp://localhost:2375 in order to access docker's api, the connection fails.
This is obviously because localhost within the container is not anymore refering to the actual host where Docker for Windows is installed.
So I used the explicit IP address to access docker's api from the container (tcp://192.168.0.10:2375), the connection was also refused!
I stopped the firewall, yet the issue was still there.
I searched for it, then I realized that I have to define "hosts" configuration variable to make docker's api accessable using the host's explicit IP address. But when I tried to set the "hosts" configuration variable, docker said: "hosts": Cannot be used in Docker for Windows
So does it mean that there is no way on Docker for Windows to host a container that can access its api?