DOCKER FILE | Chrome driver Unzip , FILE NOT FIND , Even after Giving right name and right version

I am building a Code that will run on a cloud server, IT uses Python and mainly Selenium and Chrome driver.

I have prepared a Docker File for Unzipping The Chrome Driver and storing it to the “./tmp/local/” path for using the Chrome driver for Information Extraction I am running into same problem again and again after trying everything,

  1. Changing Code Tried.
  2. Changing File name tried.
  3. Gemini Tried.
  4. ChatGPT Tried.

DOCKER FILE:

# First, specify the base Docker image.
# You can see the Docker images from Apify at https://hub.docker.com/r/apify/.
# You can also use any other image from Docker Hub.
FROM apify/actor-python:3.11
#https://developer.chrome.com/docs/chromedriver/downloads#chromedriver_1140573590

# Install Chrome, ChromeDriver, and necessary dependencies
RUN apt-get update 
  && apt-get install -y wget gnupg unzip curl || exit 1

# Add Google Chrome repository key
# Check exit code and exit if there's an error
RUN apt-key add - <<< "$(wget -qO- https://dl.google.com/linux/linux_signing_key.pub)" || exit 1

# Add Google Chrome repository list
# Check exit code and exit if there's an error
RUN echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list || exit 1

# Update package lists
RUN apt-get update || exit 1

# Install Google Chrome
RUN apt-get install -y google-chrome-stable || exit 1

# Get Chrome version
# Use grep with -E flag for extended regex
RUN CHROME_VERSION=$(google-chrome --version | grep -Eo '[0-9.]+') || exit 1

# Get ChromeDriver version (use dedicated script)
RUN curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE | grep -oE '[0-9.]+' > /tmp/chromedriver_version || exit 1

# Download ChromeDriver
RUN CHROMEDRIVER_VERSION=$(cat /tmp/chromedriver_version) && 
  wget -O /tmp/chromedriver.zip https://storage.googleapis.com/chrome-for-testing-public/125.0.6422.141/linux64/chromedriver-linux64.zip || exit 1

# Extract ChromeDriver and add to PATH
RUN unzip /tmp/chromedriver-linux64 chromedriver -d /usr/local/bin/ && 
  rm /tmp/chromedriver-linux64 || exit 1

# Clean apt cache
RUN apt-get clean || exit 1

# Remove temporary files
RUN rm -rf /var/lib/apt/lists/* || exit 1

# Set environment variable for ChromeDriver
ENV PATH="/usr/local/bin/chromedriver:${PATH}"

# Second, copy just requirements.txt into the Actor image,
# since it should be the only file that affects the dependency install in the next step,
# in order to speed up the build
COPY requirements.txt ./

# Install the packages specified in requirements.txt,
# Print the installed Python version, pip version
# and all installed packages with their versions for debugging
RUN echo "Python version:" 
 && python --version 
 && echo "Pip version:" 
 && pip --version 
 && echo "Installing dependencies:" 
 && pip install -r requirements.txt 
 && echo "All installed Python packages:" 
 && pip freeze

# Next, copy the remaining files and directories with the source code.
# Since we do this after installing the dependencies, quick build will be really fast
# for most source file changes.
COPY . ./

# Use compileall to ensure the runnability of the Actor Python code.
RUN python3 -m compileall -q .

# Specify how to launch the source code of your Actor.
# By default, the "python3 -m src" command is run
CMD ["python3", "-m", "src"]

ERROR I AM RUNNING INTO:

2024-06-07 05:46:29 (192 MB/s) - ‘/tmp/chromedriver.zip’ saved [8713889/8713889]
2024-06-07T05:46:31.155Z 
2024-06-07T05:46:31.157Z Removing intermediate container 7e0f2da2c984
2024-06-07T05:46:31.158Z  ---> a0df0f183e40
2024-06-07T05:46:31.160Z Step 10/19 : RUN unzip /tmp/chromedriver-linux64 chromedriver -d /usr/local/bin/ &&   rm /tmp/chromedriver-linux64 || exit 1
2024-06-07T05:46:31.161Z  ---> Running in 37b80f2430f9
2024-06-07T05:46:31.379Z unzip:  cannot find or open /tmp/chromedriver-linux64, /tmp/chromedriver-linux64.zip or /tmp/chromedriver-linux64.ZIP.

Please resolve this ERROR for me it is too important needs to be delivered in this week!

I have prepared a Docker File for Unzipping The Chrome Driver and storing it to the “./tmp/local/” path for using the Chrome driver for Information Extraction I am running into same problem again and again after trying everything,

  1. Changing Code Tried.
  2. Changing File name tried.
  3. Gemini Tried.
  4. ChatGPT Tried.

The result it gave me was the same error again, the “FILE NOT FOUND”

it is not able to extract the correct file from the Unzipped Folder!

New contributor

Lokesh Agarwal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật