How to access Docker web app from host OS?

I’ve followed the tutorial on the docker.io website here:

http://docs.docker.io/en/latest/examples/python_web_app/

  • Access Docker container running in Vagrant
  • Docker compose fails to setup container links properly
  • Boot2Docker/Fig mounted volume not refreshing
  • Services in CentOS 7 Docker image without systemd
  • Multiple nodejs workers in docker
  • Setting Dynamic Env variable in Docker
  • How would I access this app from a browser on my host OS?

  • Kubernetes failed to setup network for pod after executed kubeadm reset
  • Django channels and docker-compose error
  • How to restore Docker images after “Reset Factory Settings”?
  • Can MongoDB instances in Google App Engine flexible be stateful?
  • Unable to create a thinpool in Debian
  • Sha calculation of docker image layers
  • 2 Solutions collect form web for “How to access Docker web app from host OS?”

    Docker Remote API provides a way of accessing your Docker images and containers and performing many operations on them, through your Browser.
    Here is the link for Docker API v1.6 Documentation

    Hope it helps.

    The tutorial explains how this works:

    WEB_PORT=$(sudo docker port $WEB_WORKER 5000)
    

    Look up the public-facing port which is NAT-ed. Find the private port used by the container and store it inside of the WEB_PORT variable.

    # install curl if necessary, then ...
    curl http://127.0.0.1:$WEB_PORT
      Hello world!
    

    Access the web app using curl. If everything worked as planned you should see the line “Hello world!” inside of your console.

    Inside the container the application is listening on port 5000. This is translated automatically to an external port number accessible outside of the container. This makes sense because it allows multiple copies of your application to coexist on the same machine, each mapping port 5000 to a uniquely accessible port number for each app instance.

    The documentation on port redirection has more details.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.