我正在尝试在Docker容器中安装Chrome。我执行以下命令:
RUN apt-get install -y wget
RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN dpkg -i google-chrome-stable_current_amd64.deb # problem here
RUN apt -f install -y
问题在于dpkg -i
由于缺少依赖项而失败。原则上,这不是一个大问题,因为下一个命令应该可以解决这个问题,并且当从容器内部交互式运行时确实可以解决。但问题在于,在构建docker容器时,此错误会使构建过程停止。dpkg: error processing package google-chrome-stable (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
google-chrome-stable
root@78b45ab9aa33:/#
exit
我该如何解决这个问题?有没有更简单的方法安装Chrome而不引起依赖问题?我找不到要添加的软件源,以便我可以运行常规的apt-get install google-chrome
命令,这就是我想做的事情。在Google Linux存储库中,他们只提到“软件包会自动配置所需的存储库设置”。但这并不完全是我收到的信息...