gpt4 book ai didi

docker - GitLab CI中的灯塔

转载 作者:行者123 更新时间:2023-12-02 21:05:37 25 4
gpt4 key购买 nike

我正在尝试在GitLab CI中使用Lighthouse在部署后针对远程网站运行扫描。作业不断抛出错误。

我的工作配置如下所示:

lighthouse:
stage: scan
image: markhobson/node-chrome
script:
- npm install -g lighthouse lighthouse-plugin-field-performance --unsafe-perm
- lighthouse $URL --plugins=lighthouse-plugin-field-performance --chrome-flags=”--headless --no-sandbox” --verbose

我也尝试过 image: buildkite/puppeteer。在这两种情况下,当我尝试调用Lighthouse时,都会收到类似的错误,如下所示:
Wed, 09 Oct 2019 20:22:42 GMT ChromeLauncher:verbose created /tmp/lighthouse.KXhqWF0
Wed, 09 Oct 2019 20:22:42 GMT ChromeLauncher:verbose Launching with command:
"/usr/bin/google-chrome-stable" --disable-translate --disable-extensions --disable-background-networking --disable-sync --metrics-recording-only --disable-default-apps --mute-audio --no-first-run --remote-debugging-port=44495 --disable-setuid-sandbox --user-data-dir=/tmp/lighthouse.KXhqWF0 about:blank
Wed, 09 Oct 2019 20:22:42 GMT ChromeLauncher:verbose Chrome running with pid 36 on port 44495.
Wed, 09 Oct 2019 20:22:42 GMT ChromeLauncher Waiting for browser.
Wed, 09 Oct 2019 20:22:42 GMT ChromeLauncher Waiting for browser...
Wed, 09 Oct 2019 20:22:43 GMT ChromeLauncher Waiting for browser.....
Wed, 09 Oct 2019 20:22:43 GMT ChromeLauncher Waiting for browser.......
Wed, 09 Oct 2019 20:22:44 GMT ChromeLauncher Waiting for browser.........
Wed, 09 Oct 2019 20:22:44 GMT ChromeLauncher Waiting for browser...........

等等
Wed, 09 Oct 2019 20:23:07 GMT ChromeLauncher:error connect ECONNREFUSED 127.0.0.1:44495
Wed, 09 Oct 2019 20:23:07 GMT ChromeLauncher:error Logging contents of /tmp/lighthouse.KXhqWF0/chrome-err.log
Wed, 09 Oct 2019 20:23:07 GMT ChromeLauncher:error
(google-chrome-stable:36): Gtk-WARNING **: cannot open display:
[1009/202244.656645:ERROR:nacl_helper_linux.cc(310)] NaCl helper process running without a sandbox!
Most likely you need to configure your SUID sandbox correctly

Unable to connect to Chrome

我目前还不确定我需要做什么。我在问是否尝试使用更基本的节点镜像并尝试手动安装所需的东西,而我最初尝试过发现该问题,发现使用Lighthouse管理Chrome / Chromium并没有我想要的那么简单。有什么想法或建议吗?

最佳答案

您可以尝试使用此图像,该图像已全部安装好,可以执行报告https://hub.docker.com/r/femtopixel/google-lighthouse/

关于docker - GitLab CI中的灯塔,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58313026/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com