joyzoursky / docker-python-chromedriver

Dockerfile for running Python Selenium in headless Chrome (Python 2.7 / 3.6 / 3.7 / 3.8 / Alpine based Python / Chromedriver / Selenium / Xvfb included in different versions)
https://hub.docker.com/r/joyzoursky/python-chromedriver/
MIT License
638 stars 196 forks source link

Unable to locate package google-chrome-stable #30

Open ZachManno opened 2 years ago

ZachManno commented 2 years ago

Trying to run 3.9-selenium

Have used different versions of python including slim-bullseye and regular bullseye as well

 => ERROR [ 6/11] RUN apt-get install -y google-chrome-stable                                                                                                          0.5s
------
 > [ 6/11] RUN apt-get install -y google-chrome-stable:
#9 0.152 Reading package lists...
#9 0.404 Building dependency tree...
#9 0.471 Reading state information...
#9 0.518 E: Unable to locate package google-chrome-stable
------
executor failed running [/bin/sh -c apt-get install -y google-chrome-stable]: exit code: 100
ZachManno commented 2 years ago

SOLVED:

I have an M1 Apple Silicon chip Mac with default Docker arch ARM64. To fix, build the docker image with AMD64:

docker build --platform linux/amd64 --no-cache -t test-container .
petersolimine commented 1 year ago

Also on M1. For those using docker-compose, you can set the DOCKER_DEFAULT_PLATFORM environment variable i.e. export DOCKER_DEFAULT_PLATFORM=linux/amd64

Meenakshi2018 commented 1 year ago

I've an M2 and I had to add --platform=linux/amd64 to my docker file i.e. FROM --platform=linux/amd64 maven:latest to make it work.

sjunas commented 1 year ago

Hi Team, I have added --platform=linux/amd64 to my docker file and now I am not getting the error "Unable to locate package google-chrome-stable" but now my installation is getting stuck at: => [ 7/12] RUN apt-get install -y google-chrome-stable 1497.6s => => # 1. Africa 6. Asia 11. System V timezones
=> => # 2. America 7. Atlantic Ocean 12. US
=> => # 3. Antarctica 8. Europe 13. None of the above
=> => # 4. Australia 9. Indian Ocean
=> => # 5. Arctic Ocean 10. Pacific Ocean
=> => # Geographic area:

I guess this is expecting some input, but how can I pass the input from the docker file? I don't want to manually do anything when installing through dockerfile....even if I try to enter anything manually, it does not take the input..... overall, installation does not go beyond this point ......any one faced it ?

ronnyworm commented 1 year ago

Also on M1. For those using docker-compose, you can set the DOCKER_DEFAULT_PLATFORM environment variable i.e. export DOCKER_DEFAULT_PLATFORM=linux/amd64

This is also possible to use in the docker-compose.yml:

services:
  app:
    platform: linux/x86_64
    build:
      dockerfile: Dockerfile
    ...

Of course this also does not take advantage of the M1 and everything loads forever. Looking for a pure M1 solution still!

ronnyworm commented 1 year ago

I'm now using this workaround (using chromium instead of chrome) - works on M1!

apt-get install -y chromium