Not able to access tomcat application on Docker VM with host(windows) IP while using docker toolbox
Finally, I was able to find where to add the port-forwarding rule. Open the oracle VirtualBox Manager. Go to Settings-->Network --> Port Forwarding..
Here 1 rule is already available for ssh. So I added another rule for this with below configurations:HostIP:HostPort=> 127.0.0.1:9999GuestIP:GuestPort=> :8888
So now if I invoke http://localhost:9999 , it is forwarded to => docker-machine:8888 and from there it is forwarded to => tomcatVM:8080.
I could see an option of port-forwarding for boot2docker vm. But, again I am not using boot2docker. I am using docker toolbox.
Yes, you are using boot2docker.
Toolbox is just a bundle of boot2docker + docker-machine + kitematic.
Open your VirtualBox, and you will see a VM which, in the storage settings, is based on boot2docker.iso
.
See do port-forward 8888 to your host: see "Connect to a Service running inside a docker container from outside"
VBoxManage controlvm "default" natpf1 "tcp-port8888,tcp,,8888,,8888"VBoxManage controlvm "default" natpf1 "udp-port8888,udp,,8888,,8888"
(Replace default
with the name of your docker-machine: see docker-machine ls
)