BYOC - Docker Windows Image Software

seanmeyer's Avatar

seanmeyer

07 Feb, 2020 08:41 PM

Hello,

Is there any chance of having a windows image for Docker that has the same software as the Visual Studio 2017 image on AppVeyor? We have a build which is working great in the Visual Studio 2017 image, but trying to get that build working in docker has been a nightmare.

I created a powershell script and put it into the before_build area on appveyor, but I'm having problems with MSBuild not working after the new software has been installed. I think may be that the visual studio install requires a "reboot" which I can't do, because after running choco install visualstudio2017community MSBuild stops working.

Are there plans for any docker images that more closely mirror the current Visual Studio images?

  1. Support Staff 1 Posted by Feodor Fitsner on 07 Feb, 2020 08:46 PM

    Feodor Fitsner's Avatar

    Hi Sean,

    Are you running choco install visualstudio2017community inside Docker container?

  2. 2 Posted by seanmeyer on 07 Feb, 2020 08:47 PM

    seanmeyer's Avatar

    Yes, although I'm not actually running it myself. I'm adding it to the "PowerShell commands to install additional custom software to the build image" area when I set up the build environment.

    Edit: This is using the Windows Server Core 2019 Minimal image.

  3. Support Staff 3 Posted by Feodor Fitsner on 07 Feb, 2020 08:56 PM

    Feodor Fitsner's Avatar

    I see. I don't think full VS IDE could be installed into headless container, but you can try installing Build Tools instead: https://chocolatey.org/packages/microsoft-build-tools

    We were thinking about providing a container image with most of the tools pre-installed, but the concern was in the resulting size of that image and pulling time.

  4. 4 Posted by seanmeyer on 07 Feb, 2020 09:02 PM

    seanmeyer's Avatar

    I did try build tools as well actually, it also doesn't work. I think you're right that it just isn't possible to install into a headless container (I spent a long time on this before I realized this...). Personally I would find a container image with the tools super helpful!

    This might be more of a docker question than appveyor specific, but is there any way for me to use msbuild from our host platform? I'm not sure how to go about mounting the host drive to the container since it is being setup and run by the appveyor agent.

  5. Support Staff 5 Posted by Feodor Fitsner on 07 Feb, 2020 09:22 PM

    Feodor Fitsner's Avatar

    Hey, this article might be helpful: https://docs.microsoft.com/en-us/visualstudio/install/build-tools-c...

    I agree, running builds locally in Docker looks very appealing (and supported by AppVeyor), but it's going to be a challenge to mimic VM-based environment.

    Have you considered running in Hyper-V VM? Hyper-V comes for free on Windows 10 and you can go pretty far with a trial Windows Server image.

  6. 6 Posted by seanmeyer on 07 Feb, 2020 09:47 PM

    seanmeyer's Avatar

    I actually did try to use Hyper-V, but I'm not very familiar with Hyper-V and gave up on an error, timeout waiting for winrm.

    I'll look into that article you sent, thanks.

  7. Support Staff 7 Posted by Feodor Fitsner on 07 Feb, 2020 10:13 PM

    Feodor Fitsner's Avatar

    Besides VS Build Tools what else you might need on that Docker image?

  8. 8 Posted by seanmeyer on 07 Feb, 2020 10:17 PM

    seanmeyer's Avatar

    Feodor,

    I think this is what we need that isn't already there:
    * .NET Framework 3.5
    * SQL Server (I think I actually managed to install this to the container with powershell though)
    * NPM (also installed this with powershell just fine)

    Thanks for your help

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac