I wanted to connect from a docker container on a prod server to an SVN server on my laptop today. The steps were tricky, so here they are:
Exposing the local port to the prod server is pretty straightforward
laptop$ ssh -R 4204:127.0.0.1:4204 myserver
Letting docker access the server's 127.0.0.1:4204
took a little bit more digging to figure out.
laptop$ ssh myserver
server$ docker run -i -t --rm --net=host image:latest /bin/bash -l
docker$ curl http://127.0.0.1:4204
SUCCESS