我想在 Python 映像中安装 Firefox,以便能够在 Web 应用程序上运行回归测试。
假设我有以下图像,并且我想在其中安装 Firefox:
# Image:
FROM python:3.12-bullseye AS builder
# Update kernel with basic tools:
RUN apt-get update \
&& apt-get install -y \
apt-transport-https \
build-essential \
ca-certificates \
software-properties-common
但是 Firefox 在此发行版中不可用,如果我在容器内运行以下命令:
apt-cache search firefox
它什么也不返回。
我尝试添加存储库:
# Add Firefox:
RUN add-apt-repository ppa:mozillateam/ppa
RUN apt-get update --allow-insecure-repositories && apt-get install -y firefox
但后来我遇到了依赖冲突:
The following packages have unmet dependencies:
firefox : Depends: libc6 (>= 2.38) but 2.31-13+deb11u8 is to be installed
Depends: libstdc++6 (>= 13.1) but 10.2.1-6 is to be installed
Depends: libx11-xcb1 (>= 2:1.8.7) but it is not going to be installed
Recommends: xul-ext-ubufox but it is not installable
Recommends: libcanberra0 but it is not going to be installed
Recommends: libdbusmenu-glib4 but it is not going to be installed
Recommends: libdbusmenu-gtk3-4 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
如何正确安装 Firefoxpython:3.12-bullseye
镜像?