none
Visual Studio 2013 inside container installation RRS feed

  • Question

  • Hi,

    Regarding this issue: https://social.msdn.microsoft.com/Forums/en-US/b169740d-b8c1-45fd-ab60-68cd1017261b/visual-studio-2013-inside-container-installation?forum=visualstudiogeneral

    After some sleep I tried the command outside of the container and it actually opens a windows to show progress, so the error is probably related to that (somehow, it is pretty vague).

    I am starting to run out of ideas so I'll discuss with you the original goal: being able to build cpp (visual studio 2013 projects) from a container. Is it something that is currently possible ? How can I achieve that, preferably without visual studio installation (so basically only with msbuild ?).

    Regards.

    Thursday, April 20, 2017 11:28 AM

All replies

  • Hi nouamane,

    We heard similar desires from a lot of customers to build visual studio projects in containers, so we built Docker tools directly into Visual Studio 2015: https://docs.microsoft.com/en-us/dotnet/articles/core/docker/visual-studio-tools-for-docker

    Here's an example of the tools in action: https://blogs.msdn.microsoft.com/webdev/2016/11/16/new-docker-tools-for-visual-studio/

    As for VS2013 projects, I'll follow up with the team but I'm not sure off the top of my head what your options are.  

    You are correct that the issue with the commands you are trying is that containers (Windows and Linux alike) focus on running headless software with no GUI.

    Thursday, April 20, 2017 8:12 PM
  • Hi Myles,

    Thank you for your answer. I am sorry, I did not elaborate enough on the use case. What I am actually trying to do is to build a Docker image where it is possible to build (compile) C++ projects (VS2013) using CMake on top for example. This image would then be used by our CI server (Jenkins) to execute build steps inside containers running said image.

    I already came across Docker tools while searching but from my understanding it only deploys ASP.Net applications to local containers to have a production-like environment I believe (basically another way to debug apps), so that is not what I am trying to do.

    I am currently stuck in the step where CMake is not able to identify the compiler and in error logs I could see that CL.exe is not able to find the Windows API (since I only moved folders to the container and have not all registry keys set and environment to install build tools). Is there any way to have an image with build tools installed ?

    Friday, April 21, 2017 11:18 AM
  • Ah ok cool.  Thanks for explaining further!

    Alex wrote a post about getting MSBuild in containers: http://blog.alexellis.io/3-steps-to-msbuild-with-docker/

    Will that do the trick?

    • Proposed as answer by Myles Keating Monday, April 24, 2017 9:05 PM
    Monday, April 24, 2017 9:04 PM
  • After finding these docs: 

    https://msdn.microsoft.com/en-us/library/windows/desktop/aa367988(v=vs.85).aspx

    https://msdn.microsoft.com/en-us/library/windows/desktop/aa372024(v=vs.85).aspx

    I removed the /Passive option from the visual studio install command and it is now able to run inside of the container. There is still a problem though: the installer is looking, for some reason, if there is an installation for Internet Explorer 10 and it fails at this point. I tried to install IE10 without success inside of the container and finally gave up thinking that what I am trying to do does not make sense inside of a container.

    So back to build tools ...

    Alex's image was the first I tried when addressing the problem. Those are actually build tools for C# / .NET apps not C++.

    C++ Build tools are available here: http://landinghub.visualstudio.com/visual-cpp-build-tools (2015 version)

    Since I am behind a corporate proxy (and proxy settings inside containers does not work for me) at work and this is an online installer, I had to get an offline version: this is possible by running the installer outside of the container using /layout option. So choose a download destination folder and once finished cp it somewhere (you can rm the offline cache folder) with this Dockerfile:

    FROM microsoft/windowsservercore ARG INSTALL_DIR ADD $INSTALL_DIR /build/$INSTALL_DIR RUN ["cmd", "/C", "C:\\build\\%INSTALL_DIR%\\VisualCppBuildTools_Full.exe /Quiet /Full /Log C:\\build\\%INSTALL_DIR%\\INSTALL.log /NoRestart"]

    Then cd to your directory and run (the build takes time):

    docker build --build-arg INSTALL_DIR=<download_folder> -t <image_name> .

    Using this image as base I was able to build one with CMake installed and it is now able to identify the MSVC compiler. I am also able to compile cpp from the command line, linking is another issue for now since I did not identify yet all the paths of the required .libs but I think i'll manage to find them eventually.


    • Edited by nouamane Thursday, April 27, 2017 10:06 AM
    Thursday, April 27, 2017 10:03 AM