Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Google Chrome Install in Dockerfile (Raspberry Pi) #192

Open
Ralfons-06 opened this issue Jul 27, 2022 · 11 comments
Open

Issue with Google Chrome Install in Dockerfile (Raspberry Pi) #192

Ralfons-06 opened this issue Jul 27, 2022 · 11 comments

Comments

@Ralfons-06
Copy link

Hi Guys,

I'm running into problems while building the image for Docker. The Error occurs when Google Chrome get's installed

Step 5/15 : RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
 ---> Running in 51e4e6cfdfb0
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
Removing intermediate container 51e4e6cfdfb0
 ---> 53d78f1cb1d5
Step 6/15 : RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
 ---> Running in 639b2374e600
Removing intermediate container 639b2374e600
 ---> 92c34f1dd7e5
Step 7/15 : RUN apt-get -y update
 ---> Running in f30ee1788d9d
Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
Get:2 http://deb.debian.org/debian-security bullseye-security InRelease [48.4 kB]
Get:3 http://dl.google.com/linux/chrome/deb stable InRelease [1811 B]
Get:4 http://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]
Get:5 http://deb.debian.org/debian bullseye/main armhf Packages [7949 kB]
Get:6 http://dl.google.com/linux/chrome/deb stable/main amd64 Packages [1096 B]
Get:7 http://deb.debian.org/debian-security bullseye-security/main armhf Packages [168 kB]
Get:8 http://deb.debian.org/debian bullseye-updates/main armhf Packages [2604 B]
Fetched 8331 kB in 4s (2230 kB/s)
Reading package lists...
Removing intermediate container f30ee1788d9d
 ---> 6d83bbb81dde
Step 8/15 : RUN apt-get install -y google-chrome-stable
 ---> Running in 6b0279294a3c
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package google-chrome-stable
The command '/bin/sh -c apt-get install -y google-chrome-stable' returned a non-zero code: 100

Can somebody help me out?

Regards Ralfons-06

@alexanderroidl
Copy link

Hello Ralfons-06!

Thanks for reaching out. This could possibly be related to your hardware... are you running Docker build on an Apple M1 by any chance?

@Ralfons-06
Copy link
Author

Hi Alexander, no i run docker on a raspberry pi 4 B (with Raspberry Pi OS), so it should be an ARM processor.

@alexanderroidl
Copy link

Currently our Docker build is exclusively available for 64-bit-based systems. ☹️ I will take a look on getting it running on ARM somewhen soon, but feel free to try yourself in the meantime! 👍

Essentially the problem seems to be that Google Chrome is unavailable on ARM-based systems, but Chromium is.

@Ralfons-06
Copy link
Author

This solution worked for me Chrome Driver for Linux32. Though, i decided to run flathunter in plain Raspbian OS instead of a Docker Container.
I just had to manually install the chromium driver and use the installation to set up the webdriver in the abstract_crawler file:

# manually configure browser
chrome_options.BinaryLocation = "/usr/bin/chromium-browser"
driver_path = "/usr/bin/chromedriver"

if driver_arguments is not None:
    for driver_argument in driver_arguments:
        chrome_options.add_argument(driver_argument)
driver = webdriver.Chrome(
    service=Service(driver_path),
    options=chrome_options
)

@alexanderroidl
Copy link

@Ralfons-06 Running Flathunter on plain Raspbian seems to be a good quick solution at this time. I'm currently working on getting an ARMv7 image built and running and will let you guys know when it's ready.

Coming to allowing for setting a manual chromedriver path, this will also be implemented really soon.

@codders codders changed the title Issue with Google Chrome Install in Dockerfile Issue with Google Chrome Install in Dockerfile (Raspberry Pi) Nov 8, 2022
@MyaccountNo1
Copy link

@Ralfons-06 I'm also trying to run this on my raspberry. Did you just append the code block at the end of abstract_crawler?

@Ralfons-06
Copy link
Author

Ralfons-06 commented Jan 27, 2023

@Ralfons-06 I'm also trying to run this on my raspberry. Did you just append the code block at the end of abstract_crawler?

I replaced:

if driver_arguments is not None:
for driver_argument in driver_arguments:
chrome_options.add_argument(driver_argument)
driver = webdriver.Chrome(
service=Service(ChromeDriverManager().install()),
options=chrome_options
)

with:

# manually configure browser
chrome_options.BinaryLocation = "/usr/bin/chromium-browser"
driver_path = "/usr/bin/chromedriver"

if driver_arguments is not None:
    for driver_argument in driver_arguments:
        chrome_options.add_argument(driver_argument)
driver = webdriver.Chrome(
    service=Service(driver_path),
    options=chrome_options
)

to initilialize the webdriver with a local chromium installation.
Make sure to run sudo apt-get install chromium-chromedriver beforehand, so the local chromium driver is installed

Edit: Not sure if that still works

@MyaccountNo1
Copy link

Thanks for your update! I actually did exactly that but it didn't work because of a wrongly installed driver. When I reverted the changes and tried again it worked like a charm. Thanks

@codders
Copy link

codders commented Feb 2, 2023

Is there a way to turn this into a pull request, with some platform-specific detection? (e.g. platform.processor() plus platform.system()? Would one of you consider making a pull request for Rasbian support?

@ma-kopka
Copy link

Has there been any solution to that? It's not running on my installation on a Raspberry Pi either because of the Chromium issue

@codders
Copy link

codders commented Mar 22, 2023

@Ma194 Are you running in Docker? Or plain Raspbian? Have you tried the solution from @Ralfons-06 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants