jlandure/alpine-chrome

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

Opened this issue ยท 5 comments

Describe the bug
I am trying to run chromium in alpine docker in 3.10 version. For this I used below references:
#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:

  • Pull the base image of alpine of version 3.10
  • Pull chromium and chromium-chromedriver
  • (RUN apk add --no-cache chromium
    RUN apk add --no-cache chromium-chromedriver)

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.

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.

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

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

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 nwjs/nw.js#1771 (comment) regarding this

any workaround ?