Virtualbox port forwarding with docker -


i'm running virtualbox locally , i've used port forwarding this

0.0.0.0:7000 -> 0.0.0.0:7000 

so can do

curl http://localhost:7000 

from host vm , able communicate application running in vm , listening port 7000.

is possible make reverse? want set port forward able to

curl http://localhost:6000 

from vm , able communicate app runs on host , listens on port 6000.

i'm using nat.

i know bridged network , using network ip of host. can't use those. i'm interested in above.

exclaimer:

the reason of limitations above because i'm using dinghy docker , docker-machine. if change network else nat setup break. can't use else localhost since these defaults apps have , need them communicate if running both on host.

possible options:

  1. setup ssh tunnel ssh -r, see https://unix.stackexchange.com/questions/46235/how-does-reverse-ssh-tunneling-work

  2. setup nginx or apache reverse proxy on vm forward traffic host.

  3. force vm think localhost host ip adding /etc/hosts file (this has potential risk of breaking other services may depend on localhost being 127.0.0.1)


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -