I hosted our application inside a docker container. When I run docker ps
command, it gave info like below.
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6405daf98246 rdarukumalli/testapp-master "/bin/bash" 4 hours ago Up 4 hours 0.0.0.0:32797->443/tcp, 0.0.0.0:32796->8000/tcp, 0.0.0.0:32795->8080/tcp, 0.0.0.0:32794->8443/tcp, 0.0.0.0:32793->9997/tcp insane_poincare
I am trying to access this application from my machine with the following URLs. Nothing worked so far.
0.0.0.0:32795/testapp/login.jsp
0.0.0.0:8080/testapp/login.jsp
localhost:8080/testapp/login.jsp
localhost:32795/testapp/login.jsp
However, if i give the command "curl http://localhost:8080/testapp/login.jsp"
inside bash of docker container,
I can login page html is coming.
Can some one help me in understanding these URL mappings and what URL i need to use to access this login page outside docker container?
A Web URL of a container is derivied from its Template URL i.e. Web URL = Container ID + - + Template URL .
Once the image has been fully built and the Docker container is running you can visit http://localhost:8080/vnc.html where you will be prompted to insert the password specified in the docker file: password1 by default.
Try curl http://localhost:32795/testapp/login.jsp
.
Your docker ps
shows that container's port 8080 is bound to external port 32795 : [...] 0.0.0.0:32795->8080/tcp [...]
docker ps command shows the running container which displays the port your application is running. On browser type http://localhost:54529/your_application_page. if you are running application locally, then this is the port which needs to be changed in browser to access container application.
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