Установка старой версии Chrome внутри Docker
Я пытаюсь установить не актуальную версию chrome из .deb пакета внутри docker, но получаю ошибку зависимостей, которую не могу исправить.
dockerfile:
FROM python:3.10-slim-buster
RUN mkdir -p /usr/src/app/
WORKDIR /usr/src/app/
COPY . /usr/src/app/
RUN pip install --no-cache-dir -r requirements.txt
RUN apt-get update \
&& apt-get install -y wget \
&& apt-get install -y gnupg2 \
&& apt-get install -y curl \
&& apt-get install -y xvfb \
&& rm -rf /var/lib/apt/lists/*
# install google chrome
RUN wget -O /tmp/google-chrome.deb https://www.slimjet.com/chrome/download-chrome.php?file=files%2F103.0.5060.53%2Fgoogle-chrome-stable_current_amd64.deb
RUN apt-get install -y /tmp/google-chrome.deb
error:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
google-chrome-stable : Depends: fonts-liberation but it is not installable
Depends: libasound2 (>= 1.0.16) but it is not installable
Depends: libatk-bridge2.0-0 (>= 2.5.3) but it is not installable
Depends: libatk1.0-0 (>= 2.2.0) but it is not installable
Depends: libatspi2.0-0 (>= 2.9.90) but it is not installable
Depends: libcairo2 (>= 1.6.0) but it is not installable
Depends: libcups2 (>= 1.6.0) but it is not installable
Depends: libdbus-1-3 (>= 1.5.12) but it is not installable
Depends: libgbm1 (>= 8.1~0) but it is not installable
Depends: libglib2.0-0 (>= 2.39.4) but it is not installable
Depends: libgtk-3-0 (>= 3.9.10) but it is not installable or
libgtk-4-1 but it is not installable
Depends: libnspr4 (>= 2:4.9-2~) but it is not installable
Depends: libnss3 (>= 2:3.26) but it is not installable
Depends: libpango-1.0-0 (>= 1.14.0) but it is not installable
Depends: libwayland-client0 (>= 1.0.2) but it is not installable
Depends: libxcomposite1 (>= 1:0.4.4-1) but it is not installable
Depends: libxkbcommon0 (>= 0.4.1) but it is not installable
Depends: libxrandr2 but it is not installable
Depends: xdg-utils (>= 1.0.2) but it is not installable
Recommends: libu2f-udev but it is not installable
Recommends: libvulkan1 but it is not installable
E: Unable to correct problems, you have held broken packages.
Error response from daemon: The command '/bin/sh -c apt-get install -y -f /tmp/google-chrome.deb' returned a non-zero code: 100
Failed to deploy '<unknown> Dockerfile: Dockerfile': java.io.IOException: Cannot find image undetected_chromedriver chromedriver-binary locally
Я пробовал использовать RUN apt-get -f install и RUN apt-get -f install, но это не решает проблему. У кого-нибудь есть идеи?
Ответы (1 шт):
Автор решения: Eldellano
→ Ссылка
После перечисления и установки всех зависимостей - хром успешно установился.
upd. Добавляю выдержку из Dockerfile - рабочий вариант запуска необходимой версии chrome.
# зависимости для хрома
RUN apt-get install -y fonts-liberation libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 \
&& apt-get install -y libcairo2 libcups2 libdbus-1-3 libgbm1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 \
&& apt-get install -y libpango-1.0-0 libwayland-client0 libxcomposite1 libxkbcommon0 xdg-utils libu2f-udev libvulkan1
# Найти нужную версию здесь: https://www.ubuntuupdates.org/package/google_chrome/stable/main/base/google-chrome-stable
ARG CHROME_VERSION="103.0.5060.134-1"
RUN wget https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb
RUN dpkg -i google-chrome-stable_${CHROME_VERSION}_amd64.deb
RUN rm -f google-chrome-stable_${CHROME_VERSION}_amd64.deb