How to access application URL hosted in docker container?

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.

  • Docker create two bridges that corrupts my internet access
  • docker container size much greater than actual size
  • How to access the docker-container-ip:docker-container-port from outside network
  • GCE persistent disk, kubernetes, and data persistence
  • Dockerfile for tomcat
  • Docker: Set value of ENV variable using RUN command?
  • 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?

  • What does these settings do to make Elasticsearch to run on development mode?
  • How to connect to a service running on docker container from withing host MacOS machine?
  • how can I set the working directory in old version of docker in the run command?
  • How do I set resources allocated to a container using docker?
  • Apache Mesos - Docker container
  • docker flannel subnet issues
  • One Solution collect form web for “How to access application URL hosted in docker container?”

    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 will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.