I’ve been trying to make a build environment using the Windows Server Core image as a base. I’ve been able to successfully install Microsoft Build Tools 2015 on top of it, but I saw that for the Visual Studio 2017 rollout, they created an updated version. I wanted to use this updated version, but I can’t seem to get it to install. When I try to install, it just kind of sits there and does nothing. I let it sit for over an hour and nothing happens.
Thanks for the dockerfile. However I am getting DNS error. I can ping the host from my docker host machine. Not sure why this error is coming from the container?
Invoke-WebRequest : The remote name could not be resolved: 'aka.ms'
At line:1 char:76
+ ... yContinue'; Invoke-WebRequest https://aka.ms/vs/15/release/vs_BuildTo ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:Htt
pWebRequest) [Invoke-WebRequest], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShe
ll.Commands.InvokeWebRequestCommand
PS C:\> ping www.google.com
Ping request could not find host www.google.com. Please check the name and try again.
Update
Strange thing happened later on. I switched to Linux Containers mode and tried with an ubuntu container. It worked fine. Then I switched back to Windows Containers mode and this time everything worked fine. Although my issue was resolved, I don’t understand what caused the issue in the first place ?
Can this also be used please if i want to run Visual Studio inside a Windows Container on macOS Sierra with Windows Server 2016 TP5 running inside VirtualBox alongside Docker?
Basically, i am on a mac and want to be able to build and run C#/Python application using Visual Studio and Visual Studio (Mac) doesn’t support the functionality i require so thought i might be able to do inside VirtualBox with TP5 set-up.
You should be able to. If you are looking to just purely build, build tools would be a more light-weight option than a full on Visual Studio install, but both are possible.
Do you know of any blogs/guidance showing how to use this please? I am a newbie i’m afraid.
Normally i would open Visual Studio and fire up a template. Is it something similar using this image? I would actually run the application as well from here.
So, everything you could do within Visual Studio in a container would be command-line based, so you would be limited to what you can execute using the devenv.exe file (aka Visual Studio). It looks like that example is creating an app that is using what looks like WinForm, you wouldn’t actually be able to run it from the container itself.
If you are already using Windows Server 2016 directly in a VM, you’d be better off just installing Visual Studio within that and building/running the solution.
If you wanted to use the image to build, the easiest way to go about it would to put the solution files in a directory in the server 2016 VM, and start an interactive session with the container w/ that directory mounted to the container as a volume. You would use this command to do so.
docker run -it -v (directory of solution):C:\Solution alpacamybags/msbuildlite
Once the container is running, you would just invoke MSBuild, point to the solution, and just provide any arguments you need
After running the docker image and connecting via powershell I cannot install the build tools using the example in your script. (after downloading the image) Running the code on line 7 or just running without start process. And the command prompt just returns immediately without any errors.