I have been trying to set up a Dockerfile to run a project developed in Visual Studio 2015 on CPP Runtime v140 for a week or two now (specifically, this one, where I essentially just docker cp
it in and then msbuild
the solution file) and I keep running into issues.
Here is my current Dockerfile:
# escape=`
FROM mcr.microsoft.com/windows/servercore:ltsc2019
# Restore the default Windows shell for correct batch processing.
SHELL ["cmd", "/S", "/C"]
# Install Visual Studio 2015 Build Tools
ADD https://download.microsoft.com/download/E/E/D/EEDF18A8-4AED-4CE0-BEBE-70A83094FC5A/BuildTools_Full.exe C:\TEMP\vs_buildtools.exe
RUN C:\TEMP\vs_buildtools.exe `
--quiet --norestart --nocache --wait `
--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended`
--add Microsoft.Component.MSBuild
# Install C++ Runtime v140
ADD https://download.microsoft.com/download/6/A/A/6AA4EDFF-645B-48C5-81CC-ED5963AEAD48/vc_redist.x64.exe C:\TEMP\cpp_runtime.exe
RUN C:\TEMP\cpp_runtime.exe /quiet /install
# Define the entry point for the docker container.
ENTRYPOINT ["cmd.exe"]
This one hangs prohibitively long (20+ minutes, if not forever) on step 4/7, running vs_buildtools.exe. If I simply do the ADD commands and then run them while in the container itself, they always just finish instantly and don't actually change the file system.
I have been able to get Visual Studio 2015 build tools installed correctly before, but it gives me an error about Microsoft.Cpp.Default.props
not being found (similar to this StackOverflow question). It is looking for these in the v160 place, not the v140 as I'd want it to.
Can anyone spot something wrong with my Dockerfile, or suggest a better way to go about accomplishing this? I've tried many different things. I am fairly new to Docker, so maybe there is just some fundamental misunderstanding on my part. Thanks.