Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

DanielPierceIV's avatar

Laravel/Dusk not running in Docker

I have a clean custom docker image, which is built off of the base PHP:Apache image. In my dockerfile, I'm installing Google Chrome and and XVFB. Once I have Laravel up and running, I follow the Laravel Dusk installation instructions located here: https://laravel.com/docs/5.4/dusk#installation

I then run "php artisan dusk" inside of the docker container, and I get this error:

PHPUnit 5.7.17 by Sebastian Bergmann and contributors.

E                                                                   1 / 1 (100%)

Time: 2.5 minutes, Memory: 8.00MB

There was 1 error:

1) Tests\Browser\ExampleTest::testBasicExample
Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http POST to /session with params: {"desiredCapabilities":{"browserName":"chrome","platform":"ANY"}}

Operation timed out after 30000 milliseconds with 0 bytes received

/var/www/html/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:286
/var/www/html/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:126
/var/www/html/tests/DuskTestCase.php:32
/var/www/html/vendor/laravel/dusk/src/TestCase.php:208
/var/www/html/vendor/laravel/framework/src/Illuminate/Support/helpers.php:652
/var/www/html/vendor/laravel/dusk/src/TestCase.php:209
/var/www/html/vendor/laravel/dusk/src/TestCase.php:115
/var/www/html/vendor/laravel/dusk/src/TestCase.php:87
/var/www/html/tests/Browser/ExampleTest.php:21

ERRORS!
Tests: 1, Assertions: 0, Errors: 1.

After poking around a bit, I tried running "vendor/laravel/dusk/bin/chromedriver-linux", which gives me this error message:

Starting ChromeDriver 2.25.426924 (649f9b868f6783ec9de71c123212b908bf3b232e) on port 9515
Only local connections are allowed.
[0.001][SEVERE]: bind() returned an error, errno=98: Address already in use
[0.001][SEVERE]: bind() returned an error, errno=98: Address already in use
Port not available. Exiting...

I have tried multiple solutions located in the GitHub error ticket, with no success. Has anyone been able to run "php artisan dusk" inside of Docker container successfully?

0 likes
0 replies

Please or to participate in this conversation.