Visual C++ Build Tools 2015 inside containers and custom directory

Viewed 1566

Did anyone manage to:

  • install Visual C++ Build Tools 2015
  • inside Windows container
  • and in a custom directory?

Whatever I do, it always installs to standard location: C:\Program Files (x86)\Microsoft Visual Studio 14.0

Below is the example Dockerfile to demonstrate that it silently ignores /CustomInstallPath parameter:

FROM microsoft/windowsservercore:ltsc2016

# download installer
ADD https://go.microsoft.com/fwlink/?LinkId=691126 visualcppbuildtools_full.exe

# install
RUN cmd /c visualcppbuildtools_full.exe /Passive /CustomInstallPath C:\BuildTools

# test
RUN dir C:\BuildTools

I've tried with microsoft/nanoserver base images too, can't install at all.

I've tried installing via Chocolatey which also allows passing /CustomInstallPath, same result.

There are some discussions where people recommend fully uninstalling VS and anything related, but here I'm using a completely standard image, so it shouldn't matter. Anyway I've tried calling /uninstall first - didn't help.

1 Answers

AFAIK some components of the BuildTools "package" will always go in %ProgramFiles(x86)% no matter what (i.e. the C++ compiler).

Related