title: Not able to run selenium with firefox, Capybara and Docker in headless mode
body: <p>I'm trying to run tests with Selenium and Firefox with Capybara. When I run a test, it does a POST request to "<a href="http://127.0.0.1:4444:/sessions" rel="nofollow noreferrer">http://127.0.0.1:4444:/sessions</a>", it starts a server with <code>geckodriver</code> and I have a timeout error. I tried to do it manually by doing this command :</p>
  
  <pre><code>curl -d '{"desiredCapabilities": {"browserName": "firefox", "version": "", "platform": "ANY", "javascriptEnabled": 1, "cssSelectorsEnabled": 1, "takesScreenshot": 1, "nativeEvents": 0, "rotatable": 0, "unexpectedAlertBehaviour": "ignore", "moz:firefoxOptions": {"args": ["-headless"]}}, "capabilities": {"firstMatch": [{"browserName": "firefox", "moz:firefoxOptions": {}}]}}' http://127.0.0.1:4444/session
  </code></pre>
  
  <p>It fails and I have this message : <code>Error: GDK_BACKEND does not match available displays</code>. When I lauch <code>xvfb-run geckodriver</code>, it works but I have to find a way to launch geckodriver in headless mode with RSpec.</p>
  
  <p>I'm on a docker env, so I don't have a xserver installed.</p>
  
  <p>What can I do?</p>
  
  <h2>Edit</h2>
  
  <p>I have :</p>
  
  <pre><code>Firefox 52.4
  Geckodriver 0.19.0
  Capybara 2.13
  Selenium-webdriver 3.6
  </code></pre>
  
  <p>Here is my configuration of selenium :</p>
  
  <pre><code>Capybara.register_driver :selenium do |app|
    require 'selenium/webdriver'
    Capybara::Selenium::Driver.new(app, :browser =&gt; :firefox)
  end
  </code></pre>
  
  <p>Everything is running on docker.</p>