Closed matti closed 2 years ago
also:
$ docker container run -it --rm --cap-add=SYS_ADMIN zenika/alpine-chrome
[1223/161430.473823:WARNING:headless_content_main_delegate.cc(530)] Cannot create Pref Service with no user data dir.
[1223/161430.534147:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[1223/161430.534311:WARNING:dns_config_service_posix.cc(291)] Failed to read DnsConfig.
[1223/161430.553400:ERROR:vaapi_wrapper.cc(573)] Could not get a valid VA display
[1223/161430.618664:WARNING:dns_config_service_posix.cc(291)] Failed to read DnsConfig.
and also
$ docker container run -it --rm --security-opt seccomp=$(pwd)/chrome.json zenika/alpine-chrome
[1223/161833.964355:WARNING:headless_content_main_delegate.cc(530)] Cannot create Pref Service with no user data dir.
[1223/161834.001579:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[1223/161834.003209:WARNING:dns_config_service_posix.cc(291)] Failed to read DnsConfig.
[1223/161834.017905:ERROR:vaapi_wrapper.cc(573)] Could not get a valid VA display
I have a feeling that this has something to do with latest docker:
$ docker -v
Docker version 20.10.11, build dea9396
Hi! I have the same problem.
For headless mode (default), you should pass the command or attach debugger.
docker container run -it --rm zenika/alpine-chrome --no-sandbox --dump-dom https://www.google.com
or
docker container run -p9222:9222 -it --rm zenika/alpine-chrome --no-sandbox --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222 https://www.google.com
Visit localhost:9222 in browser
Thanks @anirudh-mehta, that works.
Such "hard" requirement should be put into the Dockerfile file instead (the --no-sandbox
), IMHO.
See the readme for instructions on this.