gpt4 book ai didi

google-chrome - 无法连接Chrome

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

我正在开发,需要与google chrome进行一些交互。我在Docker容器中运行应用程序。虽然它在docker外部,但我可以连接到chrome浏览器,但是当它在docker内部时,却出现类似

  ChromeLauncher:error connect ECONNREFUSED 127.0.0.1:33715 +2ms
ChromeLauncher Waiting for browser. +0ms
ChromeLauncher Waiting for browser... +0ms
ChromeLauncher Waiting for browser..... +511ms
ChromeLauncher Waiting for browser....... +502ms
ChromeLauncher Waiting for browser......... +503ms
ChromeLauncher Waiting for browser........... +502ms
ChromeLauncher Waiting for browser............. +502ms
ChromeLauncher Waiting for browser............... +502ms
ChromeLauncher Waiting for browser................. +503ms
ChromeLauncher Waiting for browser................... +502ms
ChromeLauncher Waiting for browser..................... +502ms
ChromeLauncher Waiting for browser....................... +502ms
ChromeLauncher Waiting for browser......................... +501ms
ChromeLauncher Waiting for browser........................... +502ms
ChromeLauncher Waiting for browser............................. +503ms
ChromeLauncher Waiting for browser............................... +502ms
ChromeLauncher Waiting for browser................................. +502ms
ChromeLauncher Waiting for browser................................... +500ms
ChromeLauncher Waiting for browser..................................... +502ms
ChromeLauncher Waiting for browser....................................... +501ms
ChromeLauncher Waiting for browser......................................... +501ms
ChromeLauncher Waiting for browser........................................... +502ms
ChromeLauncher Waiting for browser............................................. +501ms
ChromeLauncher Waiting for browser............................................... +502ms
ChromeLauncher Waiting for browser................................................. +503ms
ChromeLauncher Waiting for browser................................................... +502ms
ChromeLauncher Waiting for browser..................................................... +502ms
ChromeLauncher Waiting for browser....................................................... +502ms
ChromeLauncher Waiting for browser......................................................... +501ms
ChromeLauncher Waiting for browser........................................................... +502ms
ChromeLauncher Waiting for browser............................................................. +502ms
ChromeLauncher Waiting for browser............................................................... +503ms
ChromeLauncher Waiting for browser................................................................. +502ms
ChromeLauncher Waiting for browser................................................................... +502ms
ChromeLauncher Waiting for browser..................................................................... +502ms
ChromeLauncher Waiting for browser....................................................................... +502ms
ChromeLauncher Waiting for browser......................................................................... +502ms
ChromeLauncher Waiting for browser........................................................................... +502ms
ChromeLauncher Waiting for browser............................................................................. +502ms
ChromeLauncher Waiting for browser............................................................................... +502ms
ChromeLauncher Waiting for browser................................................................................. +503ms
ChromeLauncher Waiting for browser................................................................................... +502ms
ChromeLauncher Waiting for browser..................................................................................... +502ms
ChromeLauncher Waiting for browser....................................................................................... +503ms
ChromeLauncher Waiting for browser......................................................................................... +502ms
ChromeLauncher Waiting for browser........................................................................................... +502ms
ChromeLauncher Waiting for browser............................................................................................. +501ms
ChromeLauncher Waiting for browser............................................................................................... +502ms
ChromeLauncher Waiting for browser................................................................................................. +502ms
ChromeLauncher Waiting for browser................................................................................................... +502ms
ChromeLauncher Waiting for browser..................................................................................................... +502ms
ChromeLauncher Waiting for browser....................................................................................................... +502ms
ChromeLauncher:error connect ECONNREFUSED 127.0.0.1:33715 +2ms
ChromeLauncher:error Logging contents of /tmp/lighthouse.ZztambY/chrome-err.log +1ms
ChromeLauncher:error [0207/061816.421061:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
ChromeLauncher:error +0ms
Unable to connect to Chrome

最佳答案

启动应用程序容器时,可以在--add-host命令中使用 docker run 标志:

docker run --add-host="chrome:127.0.0.1" <the rest of the command>

然后,您可以通过 chrome主机名访问本地运行的chrome实例。当然,所有这些都要求您使用的端口实际上是打开的(我认为是因为该应用程序在容器外部运行)。

关于google-chrome - 无法连接Chrome,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54567758/

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