How to access tomcat running in docker container from browser?
You may be missing a port forwarding rule in the VirtualBox settings.
boot2docker vm > settings > Network > NAT adapter > Port forwarding
Note the last entry:
This way you have configured the whole chain: hostPort:virtualBoxPort
then virtualBoxPort:containerPort
, as shown in the following diagram:
Seems there's a better answer available since Docker-Tools was introduced a few months ago. If you're not using Docker Tools, take a look at https://docs.docker.com/machine
If you are using Docker Tools,
- find the docker machine name with
$ docker-machine ls
- find the docker IP address with
$ docker-machine ip <machine-name>
- use the ip address to connect, e.g.
$ curl 192.168.99.100
run boot2docker ip
to get the IP of your docker bridge. Then you can run curl BRIDGE_IP:8888
The IP will be something like 192.168.59.103. With boot2docker the VMs networking stack is not your local host but running on a virtual interface.