Website on Docker container vs Website on VM Guest
Posted: 29. Mar 2020, 17:57
Hello,
Thanks in advance for reading.
I have VirtualBox 5.2.28 running an Ubuntu Server 16.04.4 VM. On that VM I am also running docker. I can putty into the VM using an IP address I found via "ifconfig" (in the local 10.0.0 range). I am using "bridged adapter" networking.
I find that I can run a web server like Apache Tomcat on the VM inside of a docker container and see the contents in a browser from the host system. However, if I run the web server (again, Tomcat) on the VM directly, I cannot see the site from the host. Oddly, while running the website on my VM, I can "curl localhost" at the command line and get a response from that running Apache Server. This is a headless server VM, BTW.
Again, to hopefully summarize:
* Run server under docker container = I can use it from a browser running on the host.
* Run server directly on the guest/VM = cannot use it from a browser running on the host.
* Run server directly on the guest/VM = I can use "curl" and get output to stdout.
I checked, and the "ufw" is not enabled (the Ubuntu firewall seems not to be interfering).
I would have thought it would be more difficult to see a docker container site running on a VM, than a web server running on the VM. So, this surprises me.
I appreciate any input. I hope I have provided sufficient information.
Thanks in advance for reading.
I have VirtualBox 5.2.28 running an Ubuntu Server 16.04.4 VM. On that VM I am also running docker. I can putty into the VM using an IP address I found via "ifconfig" (in the local 10.0.0 range). I am using "bridged adapter" networking.
I find that I can run a web server like Apache Tomcat on the VM inside of a docker container and see the contents in a browser from the host system. However, if I run the web server (again, Tomcat) on the VM directly, I cannot see the site from the host. Oddly, while running the website on my VM, I can "curl localhost" at the command line and get a response from that running Apache Server. This is a headless server VM, BTW.
Again, to hopefully summarize:
* Run server under docker container = I can use it from a browser running on the host.
* Run server directly on the guest/VM = cannot use it from a browser running on the host.
* Run server directly on the guest/VM = I can use "curl" and get output to stdout.
I checked, and the "ufw" is not enabled (the Ubuntu firewall seems not to be interfering).
I would have thought it would be more difficult to see a docker container site running on a VM, than a web server running on the VM. So, this surprises me.
I appreciate any input. I hope I have provided sufficient information.