【问题标题】:How to install chromium in Docker based on Ubuntu 19.10 and 20.04?如何在基于 Ubuntu 19.10 和 20.04 的 Docker 中安装 chromium?
【发布时间】:2019-11-22 15:38:16
【问题描述】:

我有这个简单的 docker 文件:

FROM ubuntu:eoan 

ENV DEBIAN_FRONTEND=noninteractive 

RUN apt update && apt install -y \ 
  chromium-browser \ 
  chromium-chromedriver

当我尝试构建它时:

...
Preparing to unpack .../00-chromium-browser_77.0.3865.120-0ubuntu1.19.10.1_amd64.deb ...
=> Installing the chromium snap
==> Checking connectivity with the snap store
===> Unable to contact the store, trying every minute for the next 30 minutes

而且它似乎永远不会到达所说的快照商店。 如果图像基于disco 而不是eoan,它可以正常工作。 它在物理机上运行良好。

【问题讨论】:

    标签: docker ubuntu chromium


    【解决方案1】:

    这不是解决方案,而是解决方法。只需使用 google-chrome 代替。 有一天,我突然遇到了这个问题,总是在构建的 docker 镜像被破坏了。我的情况就像你的:ubuntu 19.10 作为 docker 镜像的基础。

    RUN curl -LO https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
    RUN apt-get install -y ./google-chrome-stable_current_amd64.deb
    RUN rm google-chrome-stable_current_amd64.deb 
    

    【讨论】:

    • 提示:即使将三个 RUN 节设为一个并用&& 链接它们的可读性较差,也会导致生成的图像层更小。如果rm 位于单独的RUN 中,则数据将消耗层中第一个RUN 的位置。
    • 这也是我们正在做的。
    • 遗憾的是,这不适用于 ARM 芯片,例如 Raspberry Pi。有什么想法吗?
    • 使用 apt-get install chromium 在我的 docker build 中工作。还有一个我正要尝试的 beta 选项:fosspost.org/chromium-deb-package-ubuntu-20-04
    • 对我来说这不起作用,因为它有许多未满足的依赖项:以下包具有未满足的依赖项: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: libatspi2.0-0 (>= 2.9.90) but it is not installable Depends: libdrm2 (>= 2.4.38) but it is not installable Depends: libgbm1 (>= 8.1~0) but it is not installable Depends: libgtk-3-0 (>= 3.9.10) but it is not installable Depends: libnspr4 (>= 2:4.9-2~) but it is not installable...
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-20
    • 2022-12-20
    • 2020-08-07
    • 2021-10-17
    • 2020-08-27
    • 2021-03-29
    相关资源
    最近更新 更多