How to call a container, running on a virtual machine, from a Windows browser?

I have Windows 7 operating system and have set up Docker. Docker starts on the virtual machine. I create some containers on Docker and test them on the command line, for example:

curl localhost:9200

Now I want to test this container from a Windows browser

  • Docker: Combine multiple images
  • deployment on minikube locally
  • Docker mongodb - how are data only containers portable
  • ERROR: hyperledger/fabric:make gotools: unrecognized import path “golang.org/x/tools/go/gcexportdata”
  • When would a Docker image and its repository have different names?
  • What is the difference between AUFS and devicemapper in docker?
  • http://localhost:9200
    

    How do I call the container, which is running on a virtual machine, from a Windows browser?

  • How do you perform Django database migrations when using Docker-Compose?
  • docker the docker registry (a private installation of it) use https (tls/ssl)
  • How can I auto-start a service in Docker using OpenRC (Alpine)?
  • Access to Docker Container Port
  • How will a server running multiple Docker virtual machines handle the TCP limitation?
  • How to run bash in detached mode in docker?
  • 2 Solutions collect form web for “How to call a container, running on a virtual machine, from a Windows browser?”

    Assuming you have ‘published’ the service to port 9200, just use the IP address of the VM instead of localhost. To get that address, you can inspect your VM setup, or use the boot2docker command:

    boot2docker ip
    

    Then, insert that address where I have the ‘x’s here in your browser:

    http://x.x.x.x:9200
    

    Or map published IP address from docker container running inside boot2docker like this:

    boot2docker ssh -L 0.0.0.0:9200:localhost:9200
    

    That way, you (and others that can access your computer) can acccess it on both of the following links:

    http://localhost:9200
    http://<host_machine_ip>:9200
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.