测试后 chrome 进程在 Docker 容器中保持 Laravel Dusk

After tests chrome process remains Laravel Dusk in a Docker container

在使用 Atlassian Bamboo 的 运行 Dusk 测试之后,Chrome 进程仍然是“僵尸”。

下面是我的驱动程序代码初始化:

$options = (new ChromeOptions())
           ->addArguments(['--disable-gpu', '--headless', '--no-sandbox', ]);

$chrome = DesiredCapabilities::chrome()
          ->setCapability(ChromeOptions::CAPABILITY,$options)
          ->setCapability('acceptInsecureCerts', true);

return RemoteWebDriver::create('http://localhost:9515', $chrome);

我的composer.json:

"require-dev":{
   "barryvdh/laravel-ide-helper":"^2.5",
   "filp/whoops":"^2.0",
   "fzaninotto/faker":"^1.4",
   "laravel/dusk":"^4.0",
   "mockery/mockery":"^1.0",
   "nunomaduro/collision":"^2.0",
   "phpunit/phpunit":"^7.0",
   "squizlabs/php_codesniffer":"3.*"
}

下面是僵尸进程的截图:

top命令的结果:

感谢回复。

经过挖掘,原因似乎是 Docker 容器上缺少标志:

必须将标志附加到您的docker run --init

来自 Atlassian 官方文档: atlassian/bamboo-server

Note that the --init flag is required to properly reap zombie processes.