Docker Community Forums

Share and learn in the Docker community.

Behat & Accessing Virtualbox VM from Docker Container


(Circlical) #1

Hi.

I’ve got a VirtualBox VM that uses NAT networking, with a port forward entry that looks like this:

Host IP: 127.0.0.1, 
Host Port: 55555
Guest IP: 10.0.2.15
Guest Port: 80

I’d like to run some Behat tests on that web app, and am trying to use the selenium/standalone-chrome docker to get this done:

docker run -d -p 4444:4444 selenium/standalone-chrome:3.4.0-einsteinium

With the VM and Docker running, I try to execute my behat tests that are configured like so:

default:
  autoload: [ %paths.base%/../contexts ]
  suites:
    core_features:
      paths: [ %paths.base%/../features ]
      contexts: [ FeatureContext ]
  extensions:
    Behat\MinkExtension:
      base_url: http://127.0.0.1:55555
      javascript_session: selenium2
      browser_name: chrome
      goutte: ~
      selenium2: ~

Yet it seems that while I am able to access port 55555 from my browser, the Docker cannot. How can I get the Docker to access that port? Right now, it errors out with this message:

This site can’t be reached 127.0.0.1 refused to connect. Try: Checking the connection Checking the proxy and the firewall ERR_CONNECTION_REFUSED Reload DETAILS

I imagine it’s rooted in how 127.0.0.1 is the docker container itself, but I am not certain how to ‘get out’ properly.

Thanks for your help, admittedly new to Docker.