4

I'm trying to follow the example for installing Visual Studio Build Tools in a container. I'm trying to figure out why the installation isn't working like I expect. I cannot even start the container that is "built" with the components I think I want; it fails to run, saying The system cannot find the path specified.. I want to start the base image and run the installer myself, so I can see what is going on. Here is what I start with:

FROM mcr.microsoft.com/dotnet/framework/sdk:4.8
ADD https://aka.ms/vs/16/release/vs_buildtools.exe C:\TEMP\vs_buildtools.exe

Then I try manually running the command in the example:

C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache --installPath C:\BuildTools --add Microsoft.VisualStudio.Workload.VCTools

This command returns immediately without doing anything. What is going on?

John Freeman
  • 1,983
  • 1
  • 22
  • 28

1 Answers1

0

It's a window app so control returns immediately. That's why our example instructions at https://docs.microsoft.com/en-us/visualstudio/install/build-tools-container?view=vs-2019 use "start /wait" (batch). Please let me know if those instructions don't work for you.

Heath
  • 2,264
  • 15
  • 15
  • 1
    I'm using the same `--wait` option that is in the instructions. There is no other mention of "wait" on that page. What do you mean by `"start /wait" (batch)`? – John Freeman Jul 07 '19 at 04:39
  • 1
    Here's a sampling of commands I've tried while inside of a container started with `docker run -it `: https://gist.github.com/thejohnfreeman/2a64c63f09847ce5ed338fb540dcfc02 One working example command that I can copy and paste might help me understand what I'm missing. – John Freeman Jul 07 '19 at 04:53
  • I made some progress. It seems the `--quiet` argument is required. Is that true? Is it trying to open a GUI otherwise? Is there no way to get logs printed to the console? – John Freeman Jul 07 '19 at 14:00
  • Yes, both --wait and --quiet are required, as is still using "start /wait" (batch) or "start-process -wait" (powershell). You need to wait for the EXE you call to complete, and --wait just tells the bootstrapper (what you're actually running) to wait for the setup application - both of which were designed for window operations primarily. – Heath Jul 08 '19 at 21:45
  • The sample docs work. That's how we create many of the containers we use for building other tools. Did you check for any error logs? – Heath Apr 02 '20 at 17:35