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.
You are using docker toolbox. The boot2docker has been depricated. Now every docker daemon (VM) is managed by Docker Machine
To see which VMs are running, use the command
docker-machine ls
It will show you the default VM running on the system along with its IP address and you can access Tomcat from that IP at port 8080. Read more about docker-machine to see how to manage multiple VMs etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With