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.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
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