How to access application URL hosted in docker container?

前端 未结 2 1985
梦如初夏
梦如初夏 2021-02-14 23:02

I hosted our application inside a docker container. When I run docker ps command, it gave info like below.

CONTAINER ID        IMAGE                         


        
相关标签:
2条回答
  • 2021-02-14 23:46

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

    0 讨论(0)
  • 2021-02-14 23:57

    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.

    0 讨论(0)
提交回复
热议问题