我正在尝试在我的 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' 的命令?
Thanks.
这是我用来将 headless chrome 安装到 aspnet 4.5 映像中的 dockerfile。享受。
# extending the `microsoft/aspnet` image.
FROM microsoft/aspnet
RUN echo 'pull down choco'
RUN powershell -Command Install-PackageProvider -name chocolatey -Force
RUN powershell -Command Set-PackageSource -Name chocolatey -Trusted
RUN powershell -Command Get-PackageSource
RUN echo 'install chrome via choco'
RUN powershell -Command Install-Package GoogleChrome -MinimumVersion 74
另一条可能的路线。将所有安装程序复制到 dockerfile 旁边的“安装程序目录”中。然后将它们复制并手动运行。
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019
RUN mkdir installers
COPY ./installers/ /installers
RUN ["c:/installers/ChromeStandaloneSetup64.exe", "/silent", "/install"]
RUN ["c:/installers/Firefox Setup 66.0.3.exe", "-ms"]
希望这可以帮助...
希望这可以帮助
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)