【发布时间】:2019-04-12 09:16:27
【问题描述】:
我正在尝试在我的 Windows 容器上安装 Chrome。我用 dockerfile 创建了我的 docker 映像,我想使用这个 dockerfile 安装 chrome。我已经尝试使用以下命令
RUN apt-get update -qqy \
&& apt-get -qqy install \
xvfb \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
但我有一个错误(我认为这是因为我在 windows 容器上,这个命令仅适用于 unbutu 容器......):
'apt-get' is not recognized as an internal or external command,
operable program or batch file.
有没有办法在 windows 容器中安装 chrome?或者任何替换 'apt-get' 的命令?
谢谢。
【问题讨论】:
-
你可以看看这里:chocolatey.org
-
您好,感谢您的评论,我查看了 Chocolatey,可能找到了解决方案,这是我使用 Chocolatey 的代码摘录:
RUN powershell -Command iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')); RUN choco install -y googlechrome但我有一个错误最后:命令'cmd /S /C choco install -y googlechrome' returned a non-zero code: 4294967295 -
你可以试试
choco install googlechrome --ignore-checksums -
我能问一下您为什么要在 Windows 容器上安装 Chrome(或任何带有 GUI 的东西)吗?还是仅适用于 Chrome Headless?
标签: docker dockerfile docker-container docker-image docker-for-windows