I am very new to Docker, and I am trying to run the default tomcat image. I see that the container is running, but when I try to hit it from my web browser, I get "CONNECTION REFUSED".
What is going on here?
Details
I have the Docker Toolbox installed on my Windows 7 PC. I migrated my boot2docker VM from an older version of boot2docker. (It didn't have much on it... just the "hello world" image.)
In the Docker Quickstart Terminal, I was able to start my new tomcat container with the following command:
docker run -i -p 8080:8080 --rm tomcat:8-jre8
I was able to verify that tomcat is up and running using the following commands:
docker ps
docker exec -i <containerId> bash
Then, within the bash shell:
curl localhost:8080
From this curl, I get back the expected HTML response.
However, if I run the curl command from the Docker Quickstart Terminal directly:
curl localhost:8080
...I get "connection refused".
Now here's something puzzling... if I run
boot2docker ip
...it gives me an error that "boot2docker-vm" is not running. How can my container be running when the boot2docker VM is down? There's something going on here that I really don't understand.
If I run "boot2docker up", I am able to get an IP address, but I still can't access tomcat from that IP address.