0

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

http://localhost:9200

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

Johnny Bones
  • 8,786
  • 7
  • 52
  • 117
somebody
  • 1,077
  • 5
  • 14
  • 32

2 Answers2

0

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
Bryan
  • 11,398
  • 3
  • 53
  • 78
0

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
Magic Wand
  • 1,572
  • 10
  • 9