如何在Docker Windows容器上安装Visual Studio 2008?

时间:2019-10-18 11:31:39

标签: windows docker windows-container

我正在一个需要Visual Studio 2008的项目中。我正在设置Docker Windows图像,并且在容器内安装Visual Studio 2008时遇到问题。

我尝试使用以下方法从en_visual_studio_2008_professional_x86_dvd_x14-26326.iso安装程序安装Visual Studio 这些基本图像: * mcr.microsoft.com / dotnet / framework / sdk:3.5-windowsservercore-ltsc2019 * mcr.microsoft.com / windows / servercore:ltsc2019

我每次都获得相同的退出代码:

PS C:\software> $processCode = Start-Process C:\software\en_visual_studio_2008_professional_x86_dvd_x14-26326\Setup\setup.exe -Wait -PassThru -ArgumentList "/q /full /norestart"

PS C:\software> Write-Host $processCode.ExitCode $processCode.ExitTime
1603 10/18/2019 1:28:52 PM

我还尝试通过vs_setup.msi安装

msiexec /i "C:\software\en_visual_studio_2008_professional_x86_dvd_x14-26326\vs_setup.msi" /L*V "C:\software\install.log"

log content:
=== Verbose logging started: 10/18/2019  10:41:59  Build type: SHIP UNICODE 5.00.10011.00  Calling process: C:\Windows\system32\msiexec.exe ===
MSI (c) (FC:70) [10:41:59:193]: Resetting cached policy values
MSI (c) (FC:70) [10:41:59:193]: Machine policy value 'Debug' is 0
MSI (c) (FC:70) [10:41:59:193]: ******* RunEngine:
           ******* Product: C:/VS-2018/vs_setup.msi
           ******* Action:
           ******* CommandLine: **********
MSI (c) (FC:70) [10:41:59:193]: Client-side and UI is none or basic: Running entire install on the server.
MSI (c) (FC:70) [10:41:59:193]: Grabbed execution mutex.
MSI (c) (FC:70) [10:41:59:240]: Cloaking enabled.
MSI (c) (FC:70) [10:41:59:240]: Attempting to enable all disabled privileges before calling Install on Server
MSI (c) (FC:70) [10:41:59:240]: Incrementing counter to disable shutdown. Counter after increment: 0
MSI (s) (34:3C) [10:41:59:256]: Running installation inside multi-package transaction C:/VS-2018/vs_setup.msi
MSI (s) (34:3C) [10:41:59:256]: Grabbed execution mutex.
MSI (s) (34:28) [10:41:59:256]: Resetting cached policy values
MSI (s) (34:28) [10:41:59:256]: Machine policy value 'Debug' is 0
MSI (s) (34:28) [10:41:59:256]: ******* RunEngine:
           ******* Product: C:/VS-2018/vs_setup.msi
           ******* Action:
           ******* CommandLine: **********
MSI (s) (34:28) [10:41:59:256]: Machine policy value 'DisableUserInstalls' is 0
MSI (s) (34:28) [10:41:59:271]: Note: 1: 2203 2: C:\Windows\Installer\inprogressinstallinfo.ipi 3: -2147287038
MSI (s) (34:28) [10:41:59:303]: SRSetRestorePoint skipped for this transaction.
MSI (s) (34:28) [10:41:59:318]: Note: 1: 1402 2: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer 3: 2
MSI (s) (34:28) [10:41:59:318]: Note: 1: 1314 2: /VS-2018/vs_setup.msi
MSI (s) (34:3C) [10:41:59:318]: User policy value 'DisableRollback' is 0
MSI (s) (34:3C) [10:41:59:318]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2
MSI (s) (34:3C) [10:41:59:318]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied.  Counter after decrement: -1
MSI (c) (FC:70) [10:41:59:334]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied.  Counter after decrement: -1
MSI (c) (FC:70) [10:41:59:334]: MainEngineThread is returning 2
=== Verbose logging stopped: 10/18/2019  10:41:59 ===

最后,我还尝试将Visual Studio 2008从我的主机复制到docker,并添加VS90COMNTOOLS环境变量,但是visual studio仍然无法正常工作。

这是我的dockerfile:

FROM mcr.microsoft.com/windows/servercore:ltsc2019

# install chocolatey
RUN powershell -Command Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
RUN cinst -y git
RUN cinst -y jdk8

RUN powershell -Command choco install -y 7zip

COPY *.ps1 /scripts/
CMD powershell

0 个答案:

没有答案