user3768495
user3768495

Reputation: 4657

docker running splash container but localhost does not load (windows 10)

I am following this tutorial to use splash to help with scraping webpages.I installed Docker toolbox and did these two steps:

$ docker pull scrapinghub/splash
$ docker run -p 5023:5023 -p 8050:8050 -p 8051:8051 scrapinghub/splash

I think it is running correctly, based on the prompted message in Docker window, which looks like this:

enter image description here

However, when I open the `localhost:8050' in a web browser, it says the localhost is not working. enter image description here

What might have gone wrong in this case? Thanks!

Upvotes: 5

Views: 2792

Answers (2)

urOutsourced
urOutsourced

Reputation: 1047

@user3768495, when you use http://192.168.99.100:8050/ , you are actually using the docker-machine ip and this ip would be available on your machine only and not on the network. To map it to localhost, you do need to port-forward the same port to your localhost. I was having the same issue and I detailed the process in below link.

https://stackoverflow.com/a/35737787/4820675

Upvotes: 1

VonC
VonC

Reputation: 1325427

You have mapped the port to your docker host (the VM), but you have not port-forwarded that same port to your actual "localhost" (your Windows host)

You need to declare that port-forwarding in the Network settings of your VM (for instance "default"), or with VBoxManage controlvm commands.

Then and only then could you access that port (used by your VM) from your Windows host (localhost).

That or you can access that same port using the IP address of your boot2docker VM: see docker-machine ls.

Upvotes: 3

Related Questions