Report this

What is the reason for this report?

Problem setting up chrome in a droplet

Posted on May 26, 2024

Hi, i was trying to run a Flask API in a droplet using the same script and Dockerfile that worked for me in other sites but i keep getting an error while i try to install chrome. I tried a couple of fixes i’ve seen in this community but nothing worked so far, any help would be appreaciated it’s my first time in digital ocean

This is the error while i build the docker in the VM:

------
Dockerfile:9
--------------------
   8 |
   9 | >>> RUN apt-get update && apt-get install -y wget unzip && \
  10 | >>>     wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
  11 | >>>     apt-get install -y ./google-chrome-stable_current_amd64.deb && \
  12 | >>>     rm google-chrome-stable_current_amd64.deb && \
  13 | >>>     apt-get clean
  14 |
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get update && apt-get install -y wget unzip &&     wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb &&     apt-get install -y ./google-chrome-stable_current_amd64.deb &&     rm google-chrome-stable_current_amd64.deb &&     apt-get clean" did not complete successfully: exit code: 100

OS: Debian 10

Dockerfile:

FROM python:3.10

WORKDIR /app

COPY . /app

RUN pip install --trusted-host pypi.install.org -r requirements.txt

RUN apt-get update && apt-get install -y wget unzip && \
    wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
    apt-get install -y ./google-chrome-stable_current_amd64.deb && \
    rm google-chrome-stable_current_amd64.deb && \
    apt-get clean

CMD ["python", "argy.py"]

requirements.txt :

beautifulsoup4==4.12.2
pandas
selenium==4.9.1
python-dotenv
telebot
gspread
gspread-dataframe
oauth2client
Flask
webdriver-manager==4.0.0
packaging
gunicorn

And lastly my selenium setup:

chrome_options = Options()
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--headless")
chrome_options.add_argument("--disable-dev-shm-usage")
chrome_options.add_argument("--disable-gpu")
chrome_options.add_argument("--window-size=1920,1080")

I don’t actually need the OS to be Debian so if anyone tried or have a fix in other OS i’m willing to try.

Thanks again!



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there!

The Dockerfile actually looks correct, I think that the issue here might be that the Chrome repository doesn’t provide arm64 packages.

Is the Droplet that you are using ARM-based by any chance? If so, what you could do is to spin up another Droplet with a regular or Intl CPU instead.

Let me know how this goes!

- Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.