我在dockerhub上看到过一些chrome的无头镜像,但是我想基于debian构建我自己的镜像。
FROM buildpack-deps:bookworm
RUN apt update && apt install -y chromium
chromium --headless --no-sandbox --disable-gpu --disable-software-rasterizer --disable-dev-shm-usage
[0518/234805.581627:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[0518/234805.586145:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[0518/234805.586179:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[0518/234805.590590:WARNING:bluez_dbus_manager.cc(247)] Floss manager not present, cannot set Floss enable/disable.
我如何解决这个问题?是否严格要求DBUS?这个问题是如何解决的?
这里描述的解决方案(添加--remote-debugging-port=9222
参数)对我不起作用:Headless chromium in ubuntu docker container
1条答案
按热度按时间sg3maiej1#
好吧,我意识到,即使返回这些错误并立即退出,它仍然“工作”。
例如,通过传递额外的参数,它可以实现预期的效果(比如截图):