How to access service running on the HOST PC from docker container

I have TCP Socker server running on my host PC and I want TCP Socket Client running inside the docker container to access the server.

I have used the command "docker run -p 2000:2000 " to apply port mapping between host PC and container, but it looks like it is applicable when we need to expose container’s port to outside world.

I am using docker for windows on my Windows 10 machine, and docker is running the Linux container.

1 Like