1) Have tcp-server console application in host system Windows Server 2016
2) Have tcp-client console application in docker container based on windowsservercore
I can't connect from tcp-client to tcp-server.
Dockerfile:
FROM microsoft/windowsservercore
ADD . /
EXPOSE 9595
ENTRYPOINT ExampleTcpClient.exe
Docker run command:
docker run -p 9595:9595 --rm mycontainer
How to connect to docker host from container on Windows 10 (Docker for Windows) I get Ip 172.18.112.1 by command ipconfig, but have error in tcp-client:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 172.18.112.1:9595
I tried several combinations:
tcp_server - 127.0.0.1:9595, tcp_client- 127.0.0.1:9595
tcp_server - 127.0.0.1:9595, tcp_client- 172.18.112.1:9595
tcp_server - 172.18.112.1:9595, tcp_client- 172.18.112.1:9595
tcp_server - 127.0.0.1:9595, tcp_client- 172.17.0.1:9595
tcp_server - host_static_ip:9595, tcp_client- 172.17.0.1:9595
tcp_server - host_static_ip:9595, tcp_client- 172.18.112.1:9595
tcp_server - host_static_ip:9595, tcp_client - host_static_ip:9595
If i start tcp_server in host system and start tcp_client in another machine with config: tcp_server - host_static_ip:9595, tcp_client - host_static_ip:9595, then it's work (without docker).