How to access Docker web app from host OS?

I’ve followed the tutorial on the website here:

  • Docker on Windows 10 doesn't start
  • Get start up status of replicas in Docker Swarm
  • How to mount local volumes in docker machine
  • Docker: Swarm worker nodes not finding locally built image
  • Freeing unnecessary Docker image's space
  • Which Kubernetes component creates a new pod?
  • How would I access this app from a browser on my host OS?

  • Debug rails app inside docker use Intellij/Rubymine
  • docker-machine fails to start host
  • How to know the file from command “docker change” is regular file or directory
  • docker push error for ibm bluemix watson
  • Docker container cannot connect to host machine: No route to host
  • Error 137 on docker build command on Win7
  • 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 ...
      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.