How to access application URL hosted in docker con

2019-04-10 03:13发布

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?

标签: docker
1条回答
Ridiculous、
2楼-- · 2019-04-10 03:59

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 [...]

查看更多
登录 后发表回答