在 Dockerfile 中的 python 映像上安装 google-chrome-stable 时出错

时间:2021-06-03 07:50:13

标签: python docker google-chrome dockerfile

我想在 docker 中的 pyton 映像上安装 google-chrome-stable,但出现以下错误:

.gitignore

我的 dockerfile 如下:

[7/9] RUN apt-get update && apt-get install -y google-chrome-stable:
#11 1.250 Hit:1 http://deb.debian.org/debian buster InRelease
#11 1.275 Get:2 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
#11 1.279 Get:3 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
#11 3.055 Get:4 http://security.debian.org/debian-security buster/updates/main amd64 Packages [291 kB]
#11 3.173 Fetched 408 kB in 2s (186 kB/s)
#11 3.173 Reading package lists...
#11 3.850 Reading package lists...
#11 4.502 Building dependency tree...
#11 4.644 Reading state information...
#11 4.751 E: Unable to locate package google-chrome-stable
------
executor failed running [/bin/sh -c apt-get update && apt-get install -y google-chrome-stable]: exit code: 100

1 个答案:

答案 0 :(得分:0)

按照说明 here,您需要添加 chrome 存储库。因此,将您的 dockerfile 更改为如下所示的内容:

FROM python:3.8
WORKDIR /test
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
RUN apt-get update && apt-get install -y google-chrome-stable