I've got a window service that exposes ports for reasons. I'm getting it to run in a container, but I can't seem to connect to the application outside of the container. I run the container like so:
docker run --net=nat -p:8080:8080 [container]
In the code where the server listens it uses
_listener = new TcpListener((IPEndPoint)listenEndPoint);//localhost,8080
If I attach to the container and run a powershell command to confirm the port is open and listening, it works. This is the powershell command:
New-Object System.Net.Sockets.TcpClient("127.0.0.1", 8080)
Is there some more configuration I need to do to get the connectivity working?
Edit: In the same service, where I'm listening for TCP clients via the code above, I host a WCF endpoint. That resolves fine.