alpine-chrome icon indicating copy to clipboard operation
alpine-chrome copied to clipboard

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

Open siddCder opened this issue 3 years ago • 5 comments

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:

  • 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.

siddCder avatar Mar 23 '21 10:03 siddCder

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.

jlandure avatar Mar 23 '21 13:03 jlandure

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

siddCder avatar Mar 23 '21 18:03 siddCder

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. 🤞

jlandure avatar Mar 23 '21 20:03 jlandure

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

ichux avatar Sep 04 '22 07:09 ichux

any workaround ?

dberardo-com avatar Sep 21 '23 14:09 dberardo-com