去掉 1>/dev/null 2>&1
直接运行命令,可以看到下面的日志:
# google-chrome --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222 --no-sandbox --disable-dev-shm-usage --headless --disable-gpu
qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
[0316/093757.042692:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[0316/093757.054974:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[0316/093757.056555:ERROR:file_path_watcher_inotify.cc(333)] inotify_init() failed: Function not implemented (38)
DevTools listening on ws://0.0.0.0:9222/devtools/browser/5a321634-a421-4021-9020-1d79701ff196
qemu: unknown option 'type=utility'
[0316/093757.193126:WARNING:bluez_dbus_manager.cc(247)] Floss manager not present, cannot set Floss enable/disable.
[0316/093757.195796:ERROR:gpu_process_host.cc(984)] GPU process launch failed: error_code=1002
[0316/093757.195896:WARNING:gpu_process_host.cc(1337)] The GPU process has crashed 1 time(s)
[0316/093757.213959:ERROR:network_service_instance_impl.cc(521)] Network service crashed, restarting service.
qemu: unknown option 'type=utility'
[0316/093757.378286:ERROR:gpu_process_host.cc(984)] GPU process launch failed: error_code=1002
[0316/093757.378369:WARNING:gpu_process_host.cc(1337)] The GPU process has crashed 2 time(s)
[0316/093757.383615:ERROR:network_service_instance_impl.cc(521)] Network service crashed, restarting service.
qemu: unknown option 'type=utility'
[0316/093757.423479:ERROR:gpu_process_host.cc(984)] GPU process launch failed: error_code=1002
[0316/093757.423589:WARNING:gpu_process_host.cc(1337)] The GPU process has crashed 3 time(s)
[0316/093757.430656:ERROR:network_service_instance_impl.cc(521)] Network service crashed, restarting service.
[0316/093757.437218:ERROR:gpu_process_host.cc(984)] GPU process launch failed: error_code=1002
[0316/093757.437273:WARNING:gpu_process_host.cc(1337)] The GPU process has crashed 4 time(s)
[0316/093757.445010:ERROR:gpu_process_host.cc(984)] GPU process launch failed: error_code=1002
[0316/093757.445074:WARNING:gpu_process_host.cc(1337)] The GPU process has crashed 5 time(s)
[0316/093757.448530:ERROR:gpu_process_host.cc(984)] GPU process launch failed: error_code=1002
[0316/093757.448576:WARNING:gpu_process_host.cc(1337)] The GPU process has crashed 6 time(s)
[0316/093757.448627:FATAL:gpu_data_manager_impl_private.cc(440)] GPU process isn't usable. Goodbye.
qemu: unknown option 'type=utility'
[0316/093757.450696:ERROR:scoped_ptrace_attach.cc(27)] ptrace: Function not implemented (38)
qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
Trace/breakpoint trap
找到一个类似的问题,看上去跟苹果的 m1/m2 芯片有关:
https://stackoverflow.com/questions/69784773/headless-chrome-on-docker-m1-error-unable-to-discover-open-window-in-chrome