jlandure / alpine-chrome

Chrome Headless docker images built upon alpine official image
https://hub.docker.com/r/zenika/alpine-chrome
Apache License 2.0
1.89k stars 245 forks source link

Not able to run chromium inside alpine based docker(v3.10) #161

Open siddCder opened 3 years ago

siddCder commented 3 years ago

Describe the bug I am trying to run chromium in alpine docker in 3.10 version. For this I used below references: https://github.com/Zenika/alpine-chrome/issues/36

I have installed both chromium and chromium-chromedriver. I have tried running chromium browser by 2 different flag configurations:

  1. chromium-browser --headless --no-sandbox --disable-setuid-sandbox --disable-gpu --disable-dev-shm-usage

    In this I am not using --disable-software-rasterizer flag, for this I am getting below error:

[0323/103212.313437:ERROR:gl_implementation.cc(282)] Failed to load /usr/lib/chromium/swiftshader/libGLESv2.so: Error loading shared library /usr/lib/chromium/swiftshader/libGLESv2.so: No such file or directory [0323/103212.315002:ERROR:viz_main_impl.cc(167)] Exiting GPU process due to errors during initialization

  1. chromium-browser --headless --no-sandbox --disable-setuid-sandbox --disable-gpu --disable-dev-shm-usage --disable-software-rasterizer

In this case I am using --disable-software-rasterizer flag, in this case the missing libGLESv2 error is resolved, but I get below error: ContextResult::kFatalFailure: Failed to create shared context for virtualization.

To Reproduce Create the docker from Dockerfile which does the following:

Once the image is created, run the chromium .

Logs / # /usr/bin/chromium-browser --headless --no-sandbox --disable-setuid-sandbox --disable-gpu --disable-dev-shm-usage [0323/104530.148785:WARNING:dns_config_service_posix.cc(339)] Failed to read DnsConfig. [0323/104530.194193:ERROR:gl_implementation.cc(282)] Failed to load /usr/lib/chromium/swiftshader/libGLESv2.so: Error loading shared library /usr/lib/chromium/swiftshader/libGLESv2.so: No such file or directory [0323/104530.196852:ERROR:viz_main_impl.cc(167)] Exiting GPU process due to errors during initialization [0323/104530.200892:WARNING:dns_config_service_posix.cc(339)] Failed to read DnsConfig. [0323/104530.202722:WARNING:gpu_process_host.cc(1207)] The GPU process has crashed 1 time(s)

/ # /usr/bin/chromium-browser --headless --no-sandbox --disable-setuid-sandbox --disable-gpu --disable-dev-shm-usage --disable-software-rasterizer [0323/104629.604906:WARNING:dns_config_service_posix.cc(339)] Failed to read DnsConfig. [0323/104629.652345:ERROR:gpu_channel_manager.cc(397)] ContextResult::kFatalFailure: Failed to create shared context for virtualization. [0323/104629.656182:WARNING:dns_config_service_posix.cc(339)] Failed to read DnsConfig.

jlandure commented 3 years ago

Hi @siddCder πŸ‘‹

Thanks for submitting an issue. πŸ‘

Are you using this Docker image zenika/alpine-chrome or trying to get your own image working?

Could you add the tag and version you are using?

Thanks.

siddCder commented 3 years ago

Hi @jlandure Yes, I am trying to build my own image. I am using node:12.13.0 as my base docker image, which inturn uses alpine 3.10, and the installed chromium version is 77.0.3865.120

jlandure commented 3 years ago

Hi @siddCder πŸ‘‹

Thanks for your reply. πŸ‘

For your information, I am not a node maintainer nor a alpine maintainer nor a chromium maintainer.

Perhaps you could be inspired by this image but if it is not related to the use of this image, I cannot let this issue as a bug but more like an help wanted issue.

Please have a look at the tags available with a node-12 with this link

For example using zenika/alpine-chrome:86-with-node-12

$ docker container run -it --rm --entrypoint "" zenika/alpine-chrome:86-with-node-12 cat /etc/alpine-release

3.12.1

I hope you will be successful with your own image. 🀞

ichux commented 2 years ago

Hi @siddCder πŸ‘‹

Thanks for your reply. πŸ‘

For your information, I am not a node maintainer nor a alpine maintainer nor a chromium maintainer.

Perhaps you could be inspired by this image but if it is not related to the use of this image, I cannot let this issue as a bug but more like an help wanted issue.

Please have a look at the tags available with a node-12 with this link

For example using zenika/alpine-chrome:86-with-node-12

$ docker container run -it --rm --entrypoint "" zenika/alpine-chrome:86-with-node-12 cat /etc/alpine-release

3.12.1

I hope you will be successful with your own image. 🀞

I made this comment https://github.com/nwjs/nw.js/issues/1771#issuecomment-1236277503 regarding this

dberardo-com commented 1 year ago

any workaround ?