Link docker container with host

I would like to forward docker-host port (3389) to docker container so container can connect to 127.0.0.1:3389. Is this somehow possible?

  • Docker cloud builtin load balancing
  • How to install docker on CentOS 7?
  • Docker for non-code deployments?
  • Docker - Rails app cannot connect to linked Postgres container (doesn't seem to be running)
  • Chaning tcp_keepalive_* inside a docker container
  • How to use local docker containers with Kubernetes
  • Bash / Docker exec: file redirection from inside a container
  • Running tests with Docker and Jenkins - Test Result
  • Docker container memory usage
  • Docker consuming more HD memory
  • Craft CMS Manager Craftman - No such file or directory: '//docker-compose.yml'
  • Running Odoo behind nginx with docker
  • One Solution collect form web for “Link docker container with host”

    The easiest thing to do would be using --net=host. That effectively puts the container in the host network (which may not be what you want). Another option would be to talk to the docker host interface.

    DOCKER_HOST=`ip route show | grep ^default | awk '{print $3}'`
    

    should figure out the IP of the host inside the container. The latter assumes that the host service listens on that (or all) host interfaces though. There are most likely more tricks achieving what you want using iptables but those two are the simplest I can come up with. You might want to check https://docs.docker.com/articles/networking/ for further details.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.