30

I have this simple docker file:

FROM ubuntu:eoan 

ENV DEBIAN_FRONTEND=noninteractive 

RUN apt update && apt install -y \ 
  chromium-browser \ 
  chromium-chromedriver

When I try to build it:

...
Preparing to unpack .../00-chromium-browser_77.0.3865.120-0ubuntu1.19.10.1_amd64.deb ...
=> Installing the chromium snap
==> Checking connectivity with the snap store
===> Unable to contact the store, trying every minute for the next 30 minutes

And it seems that it never reaches the said snap store. It works fine if the image is based on disco instead of eoan. It works fine on a physical machine.

2 Answers 2

26

It's not a solution, it's a workaround. Just use google-chrome instead. I faced with this issue when suddenly in one day that docker image that always was building become broken. My case was like your: ubuntu 19.10 as a base for docker image.

RUN curl -LO https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN apt-get install -y ./google-chrome-stable_current_amd64.deb
RUN rm google-chrome-stable_current_amd64.deb 
7
  • 4
    Tip: Even though less readable making the three RUN stanzas one and chain them with && causes the resulting image layers to be smaller. If rm is in a separate RUN the data will consume the place in the layer for the first RUN. Commented May 1, 2020 at 18:59
  • That's what we are doing as well. Commented May 8, 2020 at 18:57
  • 4
    Sadly this does not work with ARM chips such as the Raspberry Pi. Any Ideas?
    – Jörg Rech
    Commented Nov 25, 2020 at 18:35
  • 2
    using apt-get install chromium worked in my docker build. there's also this beta option that i was about to try: fosspost.org/chromium-deb-package-ubuntu-20-04 Commented Dec 2, 2020 at 4:08
  • 6
    for me this does not work as it has many unmet dependencies: The following packages have unmet dependencies: Depends: fonts-liberation but it is not installable Depends: libasound2 (>= 1.0.16) but it is not installable Depends: libatk-bridge2.0-0 (>= 2.5.3) but it is not installable Depends: libatspi2.0-0 (>= 2.9.90) but it is not installable Depends: libdrm2 (>= 2.4.38) but it is not installable Depends: libgbm1 (>= 8.1~0) but it is not installable Depends: libgtk-3-0 (>= 3.9.10) but it is not installable Depends: libnspr4 (>= 2:4.9-2~) but it is not installable... Commented Jan 7, 2021 at 13:51
0

I'm using node alpine version of my Docker. I tried many different steps on Ubuntu 20 by adding chromium and its supported libraries directly into Dockerfile but nothing worked.

What it worked for me was to

  1. Add the chromium path in puppeteer.launch and disable sandbox in args param.
const browser = await puppeteer.launch({
            executablePath: '/usr/bin/chromium-browser', // Path to Chromium executable
            args: ['--no-sandbox', '--disable-setuid-sandbox']
        });

Note: After installing chromium from step 2, usually this is the chromium path in ubuntu /usr/bin/chromium-browser

  1. And after executing docker container just run the below command. It adds the chromium package

    sudo docker exec -it DockerContainerID sh -c "apk add --no-cache chromium"

Not the answer you're looking for? Browse other questions tagged or ask your own question.