【问题标题】:Docker - installing vcredist_x86.exe inside a running containerDocker - 在正在运行的容器中安装 vcredist_x86.exe
【发布时间】:2020-05-12 18:14:20
【问题描述】:

我是码头工人的新手。我想运行 vcredist_x86.exe 以在正在运行的容器内安装 msvcr120.dll 而不使用 docker 文件。我确实将 exe 文件从主机复制到容器。我的基本映像是 Windows 服务器核心。

当我在 powershell 中运行时,我厌倦了使用以下命令: & ‘C:\vcredist_x86.exe’ 和 启动进程-FilePath “vcredist_x86.exe” 但安装甚至没有开始运行。它只是保持闲置。

输出:[1]:https://i.stack.imgur.com/jXPeR.png 很多帮助将不胜感激。谢谢。

【问题讨论】:

  • 您通常不会在正在运行的容器中安装任何软件:您所做的任何工作都会在容器被删除后丢失(并且删除容器是相当常规的操作)。如果某些命令不起作用,您需要在问题中添加更多详细信息:您到底运行了哪些命令?他们产生了什么错误?你能为你的自定义镜像提供一个完整的 Dockerfile 吗?
  • 您好,非常感谢您的回复。我对我的原始帖子进行了一些编辑。基本上,我正在尝试通过 vcredist_x86.exe 在我正在运行的容器中安装 msvcr120.dll。我厌倦了使用命令:& ‘C:\vcredist_x86.exe’ 和 Start-Process -FilePath “vcredist_x86.exe” 但它不起作用。
  • 嗨,我设法使用 start-process 命令解决了这个问题。

标签: docker dockerfile docker-for-windows


【解决方案1】:

您能否提供一个 dockerfile 如何在 docker 中安装 vcredist。

我尝试了不同的方法,但没有成功。例如我的 dockerfile。它试图安装一些东西,但系统中没有库和日志

来自 mcr.microsoft.com/windows/servercore:ltsc2019

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';

$ProgressPreference = '静默继续'; $verbosePreference='继续';"]

WORKDIR c:/temp

添加http://download.microsoft.com/download/0/5/6/056dcda9-d667-4e27-8001-8a0c6971d6b1/vcredist_x64.exec:/temp/vcredist_x64.exe

RUN Start-Process -filepath C:/temp/vcredist_x64.exe -ArgumentList "/install", "/passive", "/norestart", "'/log c:/temp/a.txt'" -PassThru |等待进程

【讨论】:

  • 欢迎来到 StackOverflow,如果需要理解答案,请添加更多描述和代码,因为它会尽快解决其他人的问题。
  • 运行 Powershell.exe -Command \ $ErrorActionPreference = 'Stop'; \ $ProgressPreference = '静默继续'; \ Invoke-WebRequest download.microsoft.com/download/9/3/F/… \ -OutFile 'c:\vc_redist.x86.exe' ; \ 启动进程 c:\vc_redist.x86.exe -ArgumentList '/passive' \ -RedirectStandardOutput 'c:\Windows\System32' -Wait ; \ Remove-Item c:\vc_redist.x86.exe -Force
  • 你可以在dockerNatTutorial下访问我的GitHublink。我有 dockerfile 供你下载
猜你喜欢
  • 1970-01-01
  • 2019-06-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-07-18
相关资源
最近更新 更多