2

I am using Boot2Docker in Yosemite trying to run swagger-io.

In virtualbox, in the vm where docker runs I port forwarded port 8080. Then I run boot to boot2docker and cloned the repository

enter image description here

$ git clone https://github.com/swagger-api/swagger-ui.git
$ cd swagger-ui-builder
$ docker build -t swagger-ui-builder .
$ docker run -p 127.0.0.1:8080:8080 swagger-ui-builder

enter image description here

The container is running but I get connection refuse when I try to load the page in the ip of the container and I don't understand why.

Cœur
  • 37,241
  • 25
  • 195
  • 267
agusgambina
  • 6,229
  • 14
  • 54
  • 94

1 Answers1

3

Try with:

docker run -p 8080:8080 swagger-ui-builder

If it still doesn't work, remove the 127.0.0.1 in the VirtualBox redirection port GUI. (that would then make it in a "broadcast mode")

That would consider the fact that your boot2docker VM is not 127.0.0.1 but (type boot2docker ip in a cmd console) typically s 192.168.59.103.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • thank you, worked! I don't understand why, but when I removed the 127.0.0.1, started working for 127.0.0.1 – agusgambina May 15 '15 at 10:45
  • Using the IP given by `boot2docker ip` worked for me! It took me some time to understand that we can't use "localhost" in this case, which you can when you are running docker in a linux host. – Alex Jul 16 '15 at 14:40
  • @Alex Indeed: I detail this indirection in http://stackoverflow.com/a/29303930/6309 (section "Hosts & Proxy: Windows => Boot2Docker => Docker Containers"). The idea remains the same for boot2docker on Mac. – VonC Jul 16 '15 at 14:44