yukinying / chrome-headless-browser-docker

Continuously building Chrome Docker image for Linux.
https://store.docker.com/community/images/yukinying/chrome-headless-browser/tags
Apache License 2.0
373 stars 53 forks source link

Container failing to boot #49

Closed roebuk closed 1 year ago

roebuk commented 1 year ago

When I attempt to run yukinying/chrome-headless-browser-stable on tag 110.0.5481.77 I receive an Error: Can't open display: in the logs of Docker. This isn't exclusive to that specific to the 110 tag as it also gives me the same error on tag 100.0.4896.127.

I'm on a M1 Mac running version 13.2.1.

Any ideas why this container is failing to boot?

yukinying commented 1 year ago

I suspect that you are using the wrong options and is not running the chrome browser with headless flag.

Please see https://github.com/yukinying/chrome-headless-browser-docker#how-to-run-the-container for details, and https://developer.chrome.com/blog/headless-chrome/ for how to run a headless chrome browser.

roebuk commented 1 year ago

Thanks for the response, @yukinying. I've tried running the stable Docker container directly and via Loki. The Can't open display displays instantly, before the container even has time to begin booting. Both commands on listed within the "How to run the container" section result in this error.

❯ docker run --init -it --rm --name chrome --shm-size=1024m -p=127.0.0.1:9222:9222 --cap-add=SYS_ADMIN yukinying/chrome-headless-browser-stable
Error: Can't open display:
❯ docker run --init -it --rm --name chrome --shm-size=1024m --cap-add=SYS_ADMIN --entrypoint=/usr/bin/google-chrome yukinying/chrome-headless-browser-stable --headless --disable-gpu --dump-dom https://www.facebook.com
Error: Can't open display:

Other Docker containers are able to boot successfully.

roebuk commented 1 year ago

I enabled X11 forwarding and when the docker image booted. I managed to get the following error:

The hardware on this system lacks support for the sse3 instruction set. The upstream chromium project no longer supports this configuration. For more information, please read and possibly provide input to their bug tracking system at http://crbug.com/1123353

roebuk commented 1 year ago

I managed to get this container booting but I had to force it with --platform linux/arm64