I wonder how I can allow network access to the host machine (in my case Mac OS X 10.10.5) from within a Docker container running in a boot2docker VM (created via docker-machine) on VirtualBox 5.0.8.
Accessing the Docker containers from the host system is working but the other way round isn’t.
There are three major strategies for getting this done:
Virtualbox port forwarding on the NAT interface. Manually open virtualbox and set up the port forwards on the NAT interface. from the VM’s point of view, the traffic will originate from the IP of the gateway on the eth0 network interface
Set up some sort of port forward process or firewall rule on your mac. listen on some port and then forward the traffic to the host-only IP.
Add a third network interface to the virtualbox machine. Set that interface to bridge mode. The VM will then be able to get a DHCP lease on the same network where your osx workstation is connected. You can check on the IP of eth2 manually when you docker-machine ssh in to the VM. That IP will be accessible on the network. (Requires you to shut down the VM to add the third network interface)