I followed the instructions on Docker Hub for the tomcat image (https://hub.docker.com/_/tomcat)
So I pulled the image
docker pull tomcat:9.0
and started it as described
docker run -it --rm -p 8888:8080 tomcat:9.0
According to the docs, this should show a 404 error page from Tomcat on the host machine when opening http://localhost:8888
But instead the browser keeps loading and eventually times out.
What am I missing here? From docker inspect
I can see that the container exposes the port
"Config": {
...
"ExposedPorts": {
"8080/tcp": {}
},
...
}
EDIT:
Container is running
thomas@debian:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6f937cf0ea93 tomcat:9.0 "catalina.sh run" 3 seconds ago Up 2 seconds 0.0.0.0:8888->8080/tcp, :::8888->8080/tcp angry_burnell
Output of running curl -v http://localhost:8888
thomas@debian:~$ curl -v http://localhost:8888
* Trying 127.0.0.1:8888...
* Connected to localhost (127.0.0.1) port 8888 (#0)
> GET / HTTP/1.1
> Host: localhost:8888
> User-Agent: curl/7.88.1
> Accept: */*
>
* Recv failure: Connection reset by peer
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer
Looks like VMWare messed things up
After reverting back to an earlier snapshot and then back to the latest one, everything started to work just fine