'Can I dockerize a Windows Build process utilizing Visual Studio?

I'm currently evaluating, if I can dockerize one of our Windows Build Processes. I haven't written or deployed the build script, but as far as I can see it is utilizing Visual Studio 2017 and Visual Studio 2015 (v14) in the following commands:

CALL "C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Auxiliary/Build/vcvarsall.bat" x64 && echo on

CALL %WORKSPACE%\mkp4client\buildscripts\workbranch\with_unique_tempdir.bat python %WORKSPACE%\tools\call_cmake\call_cmake.py %import_dir% WIN_PCSIM DEBUG VARIANT_%%V -G "Visual Studio 14 2015 Win64"

From my research I couldn't find any proper guide on how to spin up Visual Studio inside a Docker Win Container. I only found a Dockerfile for using VS BuildTools, which is from microsoft, but for some reason the image build is not working. Furthermore I doubt I can fallback on the VS BuildTools.

Has anybody had a similar use case and can provide me some information, if what I am trying to do is even possible? If so, can you share some more detailed information, pls? Thx. :)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source